mirror of
https://github.com/python/cpython.git
synced 2025-08-29 21:25:01 +00:00
Fix various spots where int/long and str/unicode unification
lead to type checks like isinstance(foo, (str, str)) or isinstance(foo, (int, int)).
This commit is contained in:
parent
5d7a7001d9
commit
aa97f04964
14 changed files with 46 additions and 51 deletions
|
@ -196,7 +196,7 @@ def _normalize_module(module, depth=2):
|
|||
"""
|
||||
if inspect.ismodule(module):
|
||||
return module
|
||||
elif isinstance(module, (str, str)):
|
||||
elif isinstance(module, str):
|
||||
return __import__(module, globals(), locals(), ["*"])
|
||||
elif module is None:
|
||||
return sys.modules[sys._getframe(depth).f_globals['__name__']]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue