Skip to content

Commit

Permalink
Remove patched enum.__new__, as the cyclic reference is no longer pre…
Browse files Browse the repository at this point in the history
…sent in Python 3.11+. (#15531)

Partially reverts #12617.

Summary of the issue:
#12617 added a patched __new__ to work around a GC cycle in Python 3.7. However, on Python 3.11 and 3.12, this is no longer present.

Description of how this pull request fixes the issue:
Remove the patched method.

Testing strategy:
Tested that

On Python 3.7, the cyclic ref is present when the patched __new__ is removed.
On Python 3.11, no unreachable object error is reported in IA2 documents.
On Python 3.12, no unreachable object error is reported in IA2 documents.
  • Loading branch information
codeofdusk authored and seanbudd committed Sep 27, 2023
1 parent 3d9a464 commit a7bd664
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 64 deletions.
4 changes: 0 additions & 4 deletions source/monkeyPatches/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,3 @@ def applyMonkeyPatches():
# Apply several monkey patches to comtypes
from . import comtypesMonkeyPatches
comtypesMonkeyPatches.applyMonkeyPatches()

# Apply patches to Enum, prevent cyclic references on ValueError during construction
from . import enumPatches
enumPatches.replace__new__()
60 changes: 0 additions & 60 deletions source/monkeyPatches/enumPatches.py

This file was deleted.

0 comments on commit a7bd664

Please sign in to comment.