diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2014-12-28 10:09:09 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2014-12-28 10:09:09 -0500 |
commit | d0e95e510f5fa73f81fc9a2ed6fc4f925f6c6460 (patch) | |
tree | d4340465e8520402d316eae289d20536ed1b545a /coverage/phystokens.py | |
parent | 3ca6fdd609eea353f89fa7047d85d6b48f2af68f (diff) | |
download | python-coveragepy-d0e95e510f5fa73f81fc9a2ed6fc4f925f6c6460.tar.gz |
Further consolidation of code reading Python source.
Diffstat (limited to 'coverage/phystokens.py')
-rw-r--r-- | coverage/phystokens.py | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/coverage/phystokens.py b/coverage/phystokens.py index f3f633d..c52e28a 100644 --- a/coverage/phystokens.py +++ b/coverage/phystokens.py @@ -262,19 +262,3 @@ if sys.version_info >= (3, 0): source_encoding = _source_encoding_py3 else: source_encoding = _source_encoding_py2 - - -def read_python_source(filename): - """Read the Python source text from `filename`. - - Returns unicode on Python 3, bytes on Python 2. - - """ - # Python 3.2 provides `tokenize.open`, the best way to open source files. - if sys.version_info >= (3, 2): - f = tokenize.open(filename) - else: - f = open(filename, "rU") - - with f: - return f.read() |