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 | 93561c76f281656169e5c062d93bc30da95d8c94 (patch) | |
tree | ac5a824337730c134d9e822bc63aa2a4ce98414c /coverage/phystokens.py | |
parent | 98a7b99ed97af0f5dfc6fc7f5219ad4b026a6dfc (diff) | |
download | python-coveragepy-git-93561c76f281656169e5c062d93bc30da95d8c94.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 f3f633dd..c52e28ae 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() |