summaryrefslogtreecommitdiffstats
path: root/Lib/imp.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2019-10-28 14:40:08 (GMT)
committerGitHub <noreply@github.com>2019-10-28 14:40:08 (GMT)
commite471e72977c83664f13d041c78549140c86c92de (patch)
treefeddc2c15e7199122f6f59992de0dab8f73b6149 /Lib/imp.py
parent3bfc8e0fcc707d200c267ff05b052fd6a63c985a (diff)
downloadcpython-e471e72977c83664f13d041c78549140c86c92de.zip
cpython-e471e72977c83664f13d041c78549140c86c92de.tar.gz
cpython-e471e72977c83664f13d041c78549140c86c92de.tar.bz2
bpo-37330: open() no longer accept 'U' in file mode (GH-16959)
open(), io.open(), codecs.open() and fileinput.FileInput no longer accept "U" ("universal newline") in the file mode. This flag was deprecated since Python 3.3.
Diffstat (limited to 'Lib/imp.py')
-rw-r--r--Lib/imp.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/imp.py b/Lib/imp.py
index 31f8c76..a6f6fc8 100644
--- a/Lib/imp.py
+++ b/Lib/imp.py
@@ -225,7 +225,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') 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_)