commit | de10bf4f4d655eef5e015931ef9891d6989887e9 | [log] [tgz] |
---|---|---|
author | Brett Cannon <brett@python.org> | Mon Apr 16 20:44:21 2012 -0400 |
committer | Brett Cannon <brett@python.org> | Mon Apr 16 20:44:21 2012 -0400 |
tree | cc6af154423accad539a120950fe4b6b2a542182 | |
parent | f138f8c1ab94618402c80c602d3d31acb0ac6910 [diff] [blame] |
Issue #13959: Fix a logic bug.
diff --git a/Lib/imp.py b/Lib/imp.py index 62623b6..2832d54 100644 --- a/Lib/imp.py +++ b/Lib/imp.py
@@ -45,7 +45,7 @@ """ 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_)