summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2009-03-04 01:10:09 (GMT)
committerBrett Cannon <bcannon@gmail.com>2009-03-04 01:10:09 (GMT)
commit7c9875c32c30ac6f70305001581400cdc0142088 (patch)
tree58bdd7b76ac546ba41450914f52f949c7c8034e9 /Lib
parent771ae9650ab25b0a2cf36f94ec6857665ddf8bc5 (diff)
downloadcpython-7c9875c32c30ac6f70305001581400cdc0142088.zip
cpython-7c9875c32c30ac6f70305001581400cdc0142088.tar.gz
cpython-7c9875c32c30ac6f70305001581400cdc0142088.tar.bz2
Move importlib over to _io.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/importlib/_bootstrap.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py
index c7cdfcf..a2a29cc 100644
--- a/Lib/importlib/_bootstrap.py
+++ b/Lib/importlib/_bootstrap.py
@@ -7,8 +7,8 @@ work. One should use importlib as the public-facing version of this module.
"""
-# Injected modules are '_warnings', 'imp', 'sys', 'marshal', 'errno', and '_os'
-# (a.k.a. 'posix', 'nt' or 'os2').
+# Injected modules are '_warnings', 'imp', 'sys', 'marshal', 'errno', '_io',
+# and '_os' (a.k.a. 'posix', 'nt' or 'os2').
# Injected attribute is path_sep.
#
# When editing this code be aware that code executed at import time CANNOT
@@ -473,7 +473,7 @@ class PyFileLoader(PyLoader):
if source_path is None:
return None
import tokenize
- with closing(_io.FileIO(source_path, 'r')) as file:
+ with closing(_io.FileIO(source_path, 'r')) as file: # Assuming bytes.
encoding, lines = tokenize.detect_encoding(file.readline)
# XXX Will fail when passed to compile() if the encoding is
# anything other than UTF-8.
@@ -482,7 +482,7 @@ class PyFileLoader(PyLoader):
def get_data(self, path):
"""Return the data from path as raw bytes."""
- return _fileio._FileIO(path, 'r').read()
+ return _io.FileIO(path, 'r').read() # Assuming bytes.
@check_name
def is_package(self, fullname):
@@ -527,7 +527,7 @@ class PyPycFileLoader(PyPycLoader, PyFileLoader):
bytecode_path = self.bytecode_path(name)
if not bytecode_path:
bytecode_path = self._base_path + suffix_list(imp.PY_COMPILED)[0]
- file = _io.FileIO(bytecode_path, 'w')
+ file = _io.FileIO(bytecode_path, 'w') # Assuming bytes.
try:
with closing(file) as bytecode_file:
bytecode_file.write(data)