bpo-34871: inspect: Don't pollute sys.modules (GH-9696)
https://bugs.python.org/issue34871
This commit is contained in:
parent
c57eb9a336
commit
6f85b826b5
|
@ -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)
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
Fix inspect module polluted ``sys.modules`` when parsing
|
||||
``__text_signature__`` of callable.
|
Loading…
Reference in New Issue