Commit 3f579152 authored by David Gobbi's avatar David Gobbi
Browse files

Fix vtkLoadPythonTkWidgets error with Python 2.

After the changes to make this module work with Python 3, it gives the
following error under Python 2.7:

UnboundLocalError: local variable 'unicode' referenced before assignment

Creating a local variable from the builtin 'unicode' fixes the issue.
parent 230500c8
Pipeline #7014 passed with stage
......@@ -61,6 +61,8 @@ def vtkLoadPythonTkWidgets(interp):
# if python 3, there is no separate "unicode" type
if sys.hexversion >= 0x03000000:
unicode = str
else:
unicode = sys.modules['__builtin__'].unicode
# attempt to load
for path in pathlist:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment