]> granicus.if.org Git - python/commitdiff
Issue #13959: Fix a logic bug.
authorBrett Cannon <brett@python.org>
Tue, 17 Apr 2012 00:44:21 +0000 (20:44 -0400)
committerBrett Cannon <brett@python.org>
Tue, 17 Apr 2012 00:44:21 +0000 (20:44 -0400)
Lib/imp.py

index 62623b63001778e833e99860ae2f14de3f3ee312..2832d54e27a335e5e7f3b864ebcbe06f7562ed71 100644 (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_)