summaryrefslogtreecommitdiffstats
path: root/Lib/inspect.py
diff options
context:
space:
mode:
authorINADA Naoki <methane@users.noreply.github.com>2018-10-04 16:47:09 (GMT)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-10-04 16:47:09 (GMT)
commit6f85b826b527e240551613aeec3118a5469e3a33 (patch)
tree2c0585ee34cbfa5c626c788a3bf7b08731f857c2 /Lib/inspect.py
parentc57eb9a336391dc22aa29e9db592fa06d7fb7101 (diff)
downloadcpython-6f85b826b527e240551613aeec3118a5469e3a33.zip
cpython-6f85b826b527e240551613aeec3118a5469e3a33.tar.gz
cpython-6f85b826b527e240551613aeec3118a5469e3a33.tar.bz2
bpo-34871: inspect: Don't pollute sys.modules (GH-9696)
https://bugs.python.org/issue34871
Diffstat (limited to 'Lib/inspect.py')
-rw-r--r--Lib/inspect.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py
index 5b7f526..857892b 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -1988,7 +1988,7 @@ def _signature_fromstr(cls, obj, s, skip_bound_arg=True):
module = sys.modules.get(module_name, None)
if module:
module_dict = module.__dict__
- sys_module_dict = sys.modules
+ sys_module_dict = sys.modules.copy()
def parse_name(node):
assert isinstance(node, ast.arg)