diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2012-12-13 21:13:32 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2012-12-13 21:13:32 -0500 |
commit | 0cef5a21d3c3a14ef1e323fe5b9569cacc5e07c7 (patch) | |
tree | 8f15d25d44fb751439e6729aa615875f65103dc4 | |
parent | 8d1241bf1bdef27a0e5d6c7615e54ba2d0079d6e (diff) | |
download | python-coveragepy-0cef5a21d3c3a14ef1e323fe5b9569cacc5e07c7.tar.gz |
pyratemp somehow claims code came from ''. Fixes #221.
-rw-r--r-- | CHANGES.txt | 6 | ||||
-rw-r--r-- | coverage/control.py | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 901a8de..b7db866 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -10,6 +10,12 @@ Version 3.6b2 - ``debug sys`` now shows the configuration file path that was read. +- If an oddly-behaved package claims that code came from an empty-string + filename, coverage.py no longer associates it with the directory name, + fixing `issue 221`_. + +.. _issue 221: https://bitbucket.org/ned/coveragepy/issue/221/coveragepy-incompatible-with-pyratemp + Version 3.6b1 -- 28 November 2012 --------------------------------- diff --git a/coverage/control.py b/coverage/control.py index 115d26c..80495ef 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -209,6 +209,10 @@ class coverage(object): should not. """ + if not filename: + # Empty string is pretty useless + return False + if filename.startswith('<'): # Lots of non-file execution is represented with artificial # filenames like "<string>", "<doctest readme.txt[0]>", or |