eric6/UI/PythonDisViewer.py

changeset 7714
79bde78e3e16
parent 7712
d8eedc2e5a0a
child 7732
4c9cf117acf6
diff -r ab61050423ef -r 79bde78e3e16 eric6/UI/PythonDisViewer.py
--- a/eric6/UI/PythonDisViewer.py	Wed Sep 23 19:17:00 2020 +0200
+++ b/eric6/UI/PythonDisViewer.py	Thu Sep 24 19:13:41 2020 +0200
@@ -416,12 +416,11 @@
         @return dictionary containing the code info data
         @rtype dict
         """
-        return {
+        codeInfoDict = {
             "name": co.co_name,
             "filename": co.co_filename,
             "firstlineno": co.co_firstlineno,
             "argcount": co.co_argcount,
-            "posonlyargcount": co.co_posonlyargcount,
             "kwonlyargcount": co.co_kwonlyargcount,
             "nlocals": co.co_nlocals,
             "stacksize": co.co_stacksize,
@@ -432,6 +431,11 @@
             "freevars": [str(var) for var in co.co_freevars],
             "cellvars": [str(var) for var in co.co_cellvars],
         }
+        try:
+            codeInfoDict["posonlyargcount"] = co.co_posonlyargcount
+        except AttributeError:
+            # does not exist prior to 3.8.0
+            codeInfoDict["posonlyargcount"] = 0
     
     def __loadDIS(self):
         """

eric ide

mercurial