Browse Source

replace deprecated inspect function (#334)

Anna Petrasova 5 years ago
parent
commit
81eb2fe61e
1 changed files with 4 additions and 1 deletions
  1. 4 1
      gui/wxpython/core/gconsole.py

+ 4 - 1
gui/wxpython/core/gconsole.py

@@ -538,7 +538,10 @@ class GConsole(wx.EvtHandler):
                                 command[0])
                                 command[0])
                         pymodule = imp.load_source(
                         pymodule = imp.load_source(
                             command[0].replace('.', '_'), pyPath)
                             command[0].replace('.', '_'), pyPath)
-                        pymain = inspect.getargspec(pymodule.main)
+                        try:  # PY3
+                            pymain = inspect.getfullargspec(pymodule.main)
+                        except AttributeError:
+                            pymain = inspect.getargspec(pymodule.main)
                         if pymain and 'giface' in pymain.args:
                         if pymain and 'giface' in pymain.args:
                             pymodule.main(self._giface)
                             pymodule.main(self._giface)
                             return
                             return