diff options
author | Christian Heimes <christian@cheimes.de> | 2013-11-23 20:14:01 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2013-11-23 20:14:01 (GMT) |
commit | 310e4c43cd87df44b170acf43f63cb94d00321c5 (patch) | |
tree | a0f7a9343a149ed2d0709f7f463e33903f6f56d5 /Lib/imp.py | |
parent | e8b1ba1699d429b1e80ea7d31032628d09c3e43e (diff) | |
parent | dd52c5a1c46b4d8e42e5e7a00f9b307f113de08d (diff) | |
download | cpython-310e4c43cd87df44b170acf43f63cb94d00321c5.zip cpython-310e4c43cd87df44b170acf43f63cb94d00321c5.tar.gz cpython-310e4c43cd87df44b170acf43f63cb94d00321c5.tar.bz2 |
merge
Diffstat (limited to 'Lib/imp.py')
-rw-r--r-- | Lib/imp.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -103,7 +103,7 @@ def source_from_cache(path): def get_suffixes(): """**DEPRECATED**""" extensions = [(s, 'rb', C_EXTENSION) for s in machinery.EXTENSION_SUFFIXES] - source = [(s, 'U', PY_SOURCE) for s in machinery.SOURCE_SUFFIXES] + source = [(s, 'r', PY_SOURCE) for s in machinery.SOURCE_SUFFIXES] bytecode = [(s, 'rb', PY_COMPILED) for s in machinery.BYTECODE_SUFFIXES] return extensions + source + bytecode @@ -297,7 +297,7 @@ def find_module(name, path=None): raise ImportError(_ERR_MSG.format(name), name=name) encoding = None - if mode == 'U': + if 'b' not in mode: with open(file_path, 'rb') as file: encoding = tokenize.detect_encoding(file.readline)[0] file = open(file_path, mode, encoding=encoding) |