We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc34710 commit 6cafbf1Copy full SHA for 6cafbf1
dill/detect.py
@@ -175,14 +175,14 @@ def nestedglobals(func, recurse=True):
175
if func is None: return list()
176
import sys
177
from .temp import capture
178
- IS_311a7 = sys.hexversion == 51052711 #FIXME: for odd behavior in 3.11a7
+ CAN_NULL = sys.hexversion >= 51052711 #NULL may be prepended >= 3.11a7
179
names = set()
180
with capture('stdout') as out:
181
dis.dis(func) #XXX: dis.dis(None) disassembles last traceback
182
for line in out.getvalue().splitlines():
183
if '_GLOBAL' in line:
184
name = line.split('(')[-1].split(')')[0]
185
- if IS_311a7:
+ if CAN_NULL:
186
names.add(name.replace('NULL + ', ''))
187
else:
188
names.add(name)
0 commit comments