diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2015-05-17 20:15:42 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2015-05-17 20:15:42 -0400 |
commit | 9e764b195723b15f29ed8182d1c6e37ac4a52c58 (patch) | |
tree | b36b42b2c83c1c7fa27b9955ea257a64d36391c4 /coverage/execfile.py | |
parent | 5c78f193074cd74154020a6053720fa09dc26928 (diff) | |
download | python-coveragepy-git-9e764b195723b15f29ed8182d1c6e37ac4a52c58.tar.gz |
All Python source is Unicode internally.
Unfortunately, this meant hacking around a silly Python 2 restriction
(can't compile a Unicode string containing an encoding declaration).
Diffstat (limited to 'coverage/execfile.py')
-rw-r--r-- | coverage/execfile.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/coverage/execfile.py b/coverage/execfile.py index 2d856897..942bfd57 100644 --- a/coverage/execfile.py +++ b/coverage/execfile.py @@ -8,6 +8,7 @@ import types from coverage.backward import BUILTINS from coverage.backward import PYC_MAGIC_NUMBER, imp, importlib_util_find_spec from coverage.misc import ExceptionDuringRun, NoCode, NoSource +from coverage.phystokens import compile_unicode from coverage.python import get_python_source @@ -182,7 +183,7 @@ def make_code_from_py(filename): except (IOError, NoSource): raise NoSource("No file to run: '%s'" % filename) - code = compile(source, filename, "exec") + code = compile_unicode(source, filename, "exec") return code |