Thanks to visit codestin.com Credit goes to github.com
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 5df2269 commit 6b1e73bCopy full SHA for 6b1e73b
pure_eval/utils.py
@@ -184,7 +184,12 @@ def copy_ast_without_context(x):
184
if field != 'ctx'
185
if hasattr(x, field)
186
}
187
- return type(x)(**kwargs)
+ a = type(x)(**kwargs)
188
+ if hasattr(a, 'ctx'):
189
+ # Python 3.13.0b2+ defaults to Load when we don't pass ctx
190
+ # https://github.com/python/cpython/pull/118871
191
+ del a.ctx
192
+ return a
193
elif isinstance(x, list):
194
return list(map(copy_ast_without_context, x))
195
else:
0 commit comments