[3.10] gh-92049: Forbid pickling constants re._constants.SUCCESS etc (GH-92070) (GH-92073)

Previously, pickling did not fail, but the result could not be unpickled.
(cherry picked from commit 6d0d547033)
This commit is contained in:
Serhiy Storchaka 2022-04-30 15:33:39 +03:00 committed by GitHub
parent 19a079690c
commit e8ff3c92f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

@ -62,6 +62,8 @@ class _NamedIntConstant(int):
def __repr__(self):
return self.name
__reduce__ = None
MAXREPEAT = _NamedIntConstant(MAXREPEAT, 'MAXREPEAT')
def _makecodes(names):

View file

@ -0,0 +1,2 @@
Forbid pickling constants ``re._constants.SUCCESS`` etc. Previously,
pickling did not fail, but the result could not be unpickled.