Quellcode durchsuchen

replace deprecated inspect function (#334)

Anna Petrasova vor 5 Jahren
Ursprung
Commit
81eb2fe61e
1 geänderte Dateien mit 4 neuen und 1 gelöschten Zeilen
  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])
                         pymodule = imp.load_source(
                             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:
                             pymodule.main(self._giface)
                             return