Loading Python Module Results in Error
Following the Tutorial found on the Paraview - Embedding Python Source as Modules (https://www.paraview.org/Wiki/ParaView/Plugin_HowTo#Embedding_Python_Source_as_Modules) it was discovered that this throws an error upon loading the plugin with paraview:
exec(code in module.__dict__) TypeError: exec: arg 1 must be a string, file, or code object
Looking into the issue looks like it is coming from Wrapping/Python/paraview/servermanager.py , class _ModuleLoader(object)
if moduleInfo.GetIsPackage:
module.__path__ = moduleInfo.GetFullName()
code = compile(moduleInfo.GetSource(), module.__file__, 'exec')
exec (code in module.__dict__)
return module
removing the parenthesis around from the exec resolves the issue:
if moduleInfo.GetIsPackage:
module.__path__ = moduleInfo.GetFullName()
code = compile(moduleInfo.GetSource(), module.__file__, 'exec')
exec code in module.__dict__
return module