Skip to content

Commit

Permalink
Fix necompiler.getArguments() on Python 3.13.0b1
Browse files Browse the repository at this point in the history
The FrameLocalsProxy object (PEP 667) cannot be cleared.

Fixes #488
  • Loading branch information
hroncok committed May 30, 2024
1 parent 9b5a451 commit fcceab4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion numexpr/necompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ def getArguments(names, local_dict=None, global_dict=None, _frame_depth: int=2):
# If we generated local_dict via an explicit reference to f_locals,
# clear the dict to prevent creating extra ref counts in the caller's scope
# See https://github.com/pydata/numexpr/issues/310
if clear_local_dict:
if clear_local_dict and hasattr(local_dict, 'clear'):
local_dict.clear()

return arguments
Expand Down

0 comments on commit fcceab4

Please sign in to comment.