mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-122459: Optimize pickling by name objects without __module__ (GH-122460)
This commit is contained in:
parent
1422500d02
commit
1bb955a2fe
4 changed files with 177 additions and 181 deletions
|
@ -2068,7 +2068,7 @@ class AbstractPicklingErrorTests:
|
|||
self.dumps(f, proto)
|
||||
self.assertIn(str(cm.exception), {
|
||||
f"Can't pickle {f!r}: it's not found as {__name__}.{f.__qualname__}",
|
||||
f"Can't get local object {f.__qualname__!r}"})
|
||||
f"Can't get local attribute {f.__qualname__!r} on {sys.modules[__name__]}"})
|
||||
# Same without a __module__ attribute (exercises a different path
|
||||
# in _pickle.c).
|
||||
del f.__module__
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue