diff options
| author | Christian Heimes <christian@cheimes.de> | 2013-11-23 21:14:01 +0100 |
|---|---|---|
| committer | Christian Heimes <christian@cheimes.de> | 2013-11-23 21:14:01 +0100 |
| commit | 310e4c43cd87df44b170acf43f63cb94d00321c5 (patch) | |
| tree | a0f7a9343a149ed2d0709f7f463e33903f6f56d5 /Lib/imp.py | |
| parent | e8b1ba1699d429b1e80ea7d31032628d09c3e43e (diff) | |
| parent | dd52c5a1c46b4d8e42e5e7a00f9b307f113de08d (diff) | |
| download | cpython-git-310e4c43cd87df44b170acf43f63cb94d00321c5.tar.gz | |
merge
Diffstat (limited to 'Lib/imp.py')
| -rw-r--r-- | Lib/imp.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/imp.py b/Lib/imp.py index 1144cd1f64..c8449c6155 100644 --- a/Lib/imp.py +++ b/Lib/imp.py @@ -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) |
