mirror of
https://github.com/python/cpython.git
synced 2025-10-10 08:53:14 +00:00
gh-92049: Forbid pickling constants re._constants.SUCCESS etc (GH-92070)
Previously, pickling did not fail, but the result could not be unpickled.
This commit is contained in:
parent
354ace8b07
commit
6d0d547033
2 changed files with 4 additions and 0 deletions
|
@ -62,6 +62,8 @@ class _NamedIntConstant(int):
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
__reduce__ = None
|
||||||
|
|
||||||
MAXREPEAT = _NamedIntConstant(MAXREPEAT, 'MAXREPEAT')
|
MAXREPEAT = _NamedIntConstant(MAXREPEAT, 'MAXREPEAT')
|
||||||
|
|
||||||
def _makecodes(*names):
|
def _makecodes(*names):
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
Forbid pickling constants ``re._constants.SUCCESS`` etc. Previously,
|
||||||
|
pickling did not fail, but the result could not be unpickled.
|
Loading…
Add table
Add a link
Reference in a new issue