Skip to content

Commit

Permalink
fix: enums initialization in PyPy
Browse files Browse the repository at this point in the history
When removing the _pb_options name from the enum attributes,
enums initialization in PyPy should not raise exception.

Refs: #506
  • Loading branch information
airbender-1 committed Nov 28, 2024
1 parent 8d24bda commit 74747ee
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions proto/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ def __new__(mcls, name, bases, attrs):
if isinstance(attrs._member_names, list):
idx = attrs._member_names.index(pb_options)
attrs._member_names.pop(idx)
elif isinstance(attrs._member_names, set): # PyPy
attrs._member_names.discard(pb_options)
else: # Python 3.11.0b3
del attrs._member_names[pb_options]

Expand Down

0 comments on commit 74747ee

Please sign in to comment.