소스 검색

replace deprecated inspect function (#334)

Anna Petrasova 5 년 전
부모
커밋
70e64a3cb3
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  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