mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Issue #13959: Fix a logic bug.
This commit is contained in:
parent
f138f8c1ab
commit
de10bf4f4d
1 changed files with 1 additions and 1 deletions
|
@ -45,7 +45,7 @@ def load_module(name, file, filename, details):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
suffix, mode, type_ = details
|
suffix, mode, type_ = details
|
||||||
if mode and (not mode.startswith(('r', 'U'))) or '+' in mode:
|
if mode and (not mode.startswith(('r', 'U')) or '+' in mode):
|
||||||
raise ValueError('invalid file open mode {!r}'.format(mode))
|
raise ValueError('invalid file open mode {!r}'.format(mode))
|
||||||
elif file is None and type_ in {PY_SOURCE, PY_COMPILED}:
|
elif file is None and type_ in {PY_SOURCE, PY_COMPILED}:
|
||||||
msg = 'file object required for import (type code {})'.format(type_)
|
msg = 'file object required for import (type code {})'.format(type_)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue