Skip to content

Commit e8ff3c9

Browse files
[3.10] pythongh-92049: Forbid pickling constants re._constants.SUCCESS etc (pythonGH-92070) (pythonGH-92073)
Previously, pickling did not fail, but the result could not be unpickled. (cherry picked from commit 6d0d547)
1 parent 19a0796 commit e8ff3c9

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

Lib/sre_constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ def __new__(cls, value, name):
6262
def __repr__(self):
6363
return self.name
6464

65+
__reduce__ = None
66+
6567
MAXREPEAT = _NamedIntConstant(MAXREPEAT, 'MAXREPEAT')
6668

6769
def _makecodes(names):
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Forbid pickling constants ``re._constants.SUCCESS`` etc. Previously,
2+
pickling did not fail, but the result could not be unpickled.

0 commit comments

Comments
 (0)