Commit de10bf4f authored by Brett Cannon's avatar Brett Cannon

Issue #13959: Fix a logic bug.

parent f138f8c1
......@@ -45,7 +45,7 @@ def load_module(name, file, filename, 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))
elif file is None and type_ in {PY_SOURCE, PY_COMPILED}:
msg = 'file object required for import (type code {})'.format(type_)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment