diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2012-11-08 22:16:35 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2012-11-08 22:16:35 -0500 |
commit | 48bcf7bb7f6d52ea0672fbadd3bd4b05a43960c1 (patch) | |
tree | fd2368c6eec9f4e0a357ea28fea6d106455c668b /coverage/execfile.py | |
parent | 74adfa69b41443b3b83d6b14c2fc57fffb638384 (diff) | |
download | python-coveragepy-git-48bcf7bb7f6d52ea0672fbadd3bd4b05a43960c1.tar.gz |
A work-in-progress for #207, a minor improvement, and a commented-out test that shows the problem.
Diffstat (limited to 'coverage/execfile.py')
-rw-r--r-- | coverage/execfile.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/coverage/execfile.py b/coverage/execfile.py index 3283a3f7..587c2d3c 100644 --- a/coverage/execfile.py +++ b/coverage/execfile.py @@ -110,7 +110,7 @@ def run_python_file(filename, args, package=None): # We have the source. `compile` still needs the last line to be clean, # so make sure it is, then compile a code object from it. - if source[-1] != '\n': + if not source or source[-1] != '\n': source += '\n' code = compile(source, filename, "exec") |