diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2022-04-30 10:03:23 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-30 10:03:23 (GMT) |
commit | 6d0d547033e295f91f05030322acfbb0e280fc1f (patch) | |
tree | 33930640605e644dea7ed7b61fee5ee7c86f0429 /Lib/re | |
parent | 354ace8b07e7d445fd2de713b6af1271536adce0 (diff) | |
download | cpython-6d0d547033e295f91f05030322acfbb0e280fc1f.zip cpython-6d0d547033e295f91f05030322acfbb0e280fc1f.tar.gz cpython-6d0d547033e295f91f05030322acfbb0e280fc1f.tar.bz2 |
gh-92049: Forbid pickling constants re._constants.SUCCESS etc (GH-92070)
Previously, pickling did not fail, but the result could not be unpickled.
Diffstat (limited to 'Lib/re')
-rw-r--r-- | Lib/re/_constants.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/re/_constants.py b/Lib/re/_constants.py index c45ce40..71204d9 100644 --- a/Lib/re/_constants.py +++ b/Lib/re/_constants.py @@ -62,6 +62,8 @@ class _NamedIntConstant(int): def __repr__(self): return self.name + __reduce__ = None + MAXREPEAT = _NamedIntConstant(MAXREPEAT, 'MAXREPEAT') def _makecodes(*names): |