diff options
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/bz2.py | 3 | ||||
-rwxr-xr-x | Lib/tarfile.py | 2 | ||||
-rw-r--r-- | Lib/tokenize.py | 3 |
3 files changed, 3 insertions, 5 deletions
@@ -9,6 +9,7 @@ __all__ = ["BZ2File", "BZ2Compressor", "BZ2Decompressor", __author__ = "Nadeem Vawda <nadeem.vawda@gmail.com>" +from builtins import open as _builtin_open import io import warnings @@ -27,8 +28,6 @@ _MODE_WRITE = 3 _BUFFER_SIZE = 8192 -_builtin_open = open - class BZ2File(io.BufferedIOBase): diff --git a/Lib/tarfile.py b/Lib/tarfile.py index ea7a89a..720bbf7 100755 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -38,6 +38,7 @@ __credits__ = "Gustavo Niemeyer, Niels Gust\u00e4bel, Richard Townsend." #--------- # Imports #--------- +from builtins import open as bltn_open import sys import os import io @@ -2433,7 +2434,6 @@ def is_tarfile(name): except TarError: return False -bltn_open = open open = TarFile.open diff --git a/Lib/tokenize.py b/Lib/tokenize.py index 0659c55..8bc83fd 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(). |