Commit c96458b9 authored by David Gobbi's avatar David Gobbi
Browse files

Make vtk/__init__.py compatible with py3k.

parent e1ff8866
......@@ -192,8 +192,13 @@ if(PYTHON_EXECUTABLE)
# Wrapping/Python/vtk/*.py
unset(VTK_PYTHON_FILES)
unset(VTK_PYTHON_IMPORT_ALL)
set(LOCAL_IMPORT_DOT ".")
if("${PYTHON_MAJOR_VERSION}" LESS 3)
set(LOCAL_IMPORT_DOT "")
endif()
foreach(module ${VTK_PYTHON_MODULES})
set(VTK_PYTHON_IMPORT_ALL "${VTK_PYTHON_IMPORT_ALL}from ${module} import *\n")
set(VTK_PYTHON_IMPORT_ALL
"${VTK_PYTHON_IMPORT_ALL}from ${LOCAL_IMPORT_DOT}${module} import *\n")
configure_file(vtk/module.py.in vtk/${module}.py @ONLY)
list(APPEND VTK_PYTHON_FILES
"${CMAKE_CURRENT_BINARY_DIR}/vtk/${module}.py")
......
......@@ -62,10 +62,10 @@ def vtkImageScalarTypeNameMacro(type):
return __vtkTypeNameDict[type]
# import convenience decorators
from util.misc import calldata_type
from @LOCAL_IMPORT_DOT@util.misc import calldata_type
# import the vtkVariant helpers
from util.vtkVariant import *
from @LOCAL_IMPORT_DOT@util.vtkVariant import *
# reset the dlopen flags to the original state if possible.
if dl and (os.name == 'posix') and orig_dlopen_flags:
......
Supports Markdown
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