Salome HOME
Merge remote-tracking branch 'origin/ngr/python3_dev' into ngr/python3_dev
[modules/kernel.git] / src / KERNEL_PY / salome_iapp.py
index 771a68a048fe55d8636f054e5e768f488543f843..b7aa1557d240cacb290d435577274b168e2b1e97 100755 (executable)
@@ -38,11 +38,11 @@ def ImportComponentGUI(ComponentName):
     if IN_SALOME_GUI:
         libName = "lib" + ComponentName + "_Swig"
         command = "from " + libName + " import *"
-        exec ( command )
+        exec (command, globals())
         constructor = ComponentName + "_Swig()"
         command = "gui = " + constructor
-        exec ( command )
-        return gui
+        exec (command, globals())
+        return gui  # @UndefinedVariable
     else:
         print("Warning: ImportComponentGUI(",ComponentName,") outside GUI !")
         print("calls to GUI methods may crash...")
@@ -100,7 +100,7 @@ class SalomeOutsideGUI(object):
     def getSelected(self, i):
         """Get the selection number i """
         print("SalomeOutsideGUI: no selection mecanism available outside GUI")
-        return none
+        return None
     
     def AddIObject(self, Entry):
         """Add an entry"""