Skip to content

Commit

Permalink
[3.9] gh-92049: Forbid pickling constants re._constants.SUCCESS etc (G…
Browse files Browse the repository at this point in the history
…H-92070) (GH-92073) (GH-92102)

Previously, pickling did not fail, but the result could not be unpickled.
(cherry picked from commit 6d0d547)
(cherry picked from commit e8ff3c9)
  • Loading branch information
serhiy-storchaka committed May 1, 2022
1 parent fcbff77 commit 54f06ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Lib/sre_constants.py
Expand Up @@ -62,6 +62,8 @@ def __new__(cls, value, name):
def __repr__(self):
return self.name

__reduce__ = None

MAXREPEAT = _NamedIntConstant(MAXREPEAT, 'MAXREPEAT')

def _makecodes(names):
Expand Down
@@ -0,0 +1,2 @@
Forbid pickling constants ``re._constants.SUCCESS`` etc. Previously,
pickling did not fail, but the result could not be unpickled.

0 comments on commit 54f06ae

Please sign in to comment.