aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-03-11 17:31:33 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2015-03-11 17:31:33 +0200
commitca8b64461db5469fc4dc7e43cacb747046a0be53 (patch)
treea41afac14f69a0abd8ddf7cc12e52fee40d7cc53 /Lib/tokenize.py
parentClose issue23467: add %r compatibility to bytes and bytearray (diff)
parentIssue #23615: Modules bz2, tarfile and tokenize now can be reloaded with (diff)
downloadcpython-ca8b64461db5469fc4dc7e43cacb747046a0be53.tar.gz
cpython-ca8b64461db5469fc4dc7e43cacb747046a0be53.tar.bz2
cpython-ca8b64461db5469fc4dc7e43cacb747046a0be53.zip
Issue #23615: Modules bz2, tarfile and tokenize now can be reloaded with
imp.reload(). Patch by Thomas Kluyver.
Diffstat (limited to 'Lib/tokenize.py')
-rw-r--r--Lib/tokenize.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/tokenize.py b/Lib/tokenize.py
index 0659c55a068..8bc83fda545 100644
--- a/Lib/tokenize.py
+++ b/Lib/tokenize.py
@@ -24,6 +24,7 @@ __author__ = 'Ka-Ping Yee <ping@lfw.org>'
__credits__ = ('GvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, '
'Skip Montanaro, Raymond Hettinger, Trent Nelson, '
'Michael Foord')
+from builtins import open as _builtin_open
from codecs import lookup, BOM_UTF8
import collections
from io import TextIOWrapper
@@ -429,8 +430,6 @@ def detect_encoding(readline):
return default, [first, second]
-_builtin_open = open
-
def open(filename):
"""Open a file in read only mode using the encoding detected by
detect_encoding().