Issue #13959: Fix a logic bug.

This commit is contained in:
Brett Cannon 2012-04-16 20:44:21 -04:00
parent f138f8c1ab
commit de10bf4f4d
1 changed files with 1 additions and 1 deletions

View File

@ -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_)