summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2012-09-06 22:54:35 -0400
committerNed Batchelder <ned@nedbatchelder.com>2012-09-06 22:54:35 -0400
commit825acb3051853f0ac849df5bc15920ba932391e1 (patch)
tree434b48caebdb18f5afc488269987b164e2c9adf7
parentaef97b8882265a821bffe08fb7a633c1d5eabdb7 (diff)
downloadpython-coveragepy-git-825acb3051853f0ac849df5bc15920ba932391e1.tar.gz
Where we deal with .pyc files, also deal with .pyo files. Fixes #195.
-rw-r--r--CHANGES.txt5
-rw-r--r--coverage/codeunit.py2
2 files changed, 6 insertions, 1 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 861be555..4ec429ab 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -18,6 +18,9 @@ Version 3.5.3b1
- Fixed memory leaks under Python 3, thanks, Brett Cannon.
+- Optimized .pyo files may not have been handled correctly, `issue 195`_.
+ Thanks, Marius Gedminas.
+
- Try to do a better job of the impossible task of detecting when we can't
build the C extension, fixing `issue 183`_.
@@ -26,9 +29,11 @@ Version 3.5.3b1
.. _issue 82: https://bitbucket.org/ned/coveragepy/issue/82/tokenerror-when-generating-html-report
.. _issue 179: https://bitbucket.org/ned/coveragepy/issue/179/htmlreporter-fails-when-source-file-is
.. _issue 183: https://bitbucket.org/ned/coveragepy/issue/183/install-fails-for-python-23
+.. _issue 195: https://bitbucket.org/ned/coveragepy/issue/195/pyo-file-handling-in-codeunit
.. _tox: http://tox.readthedocs.org/
+
Version 3.5.2 --- 4 May 2012
----------------------------
diff --git a/coverage/codeunit.py b/coverage/codeunit.py
index 1999c50c..eb55489d 100644
--- a/coverage/codeunit.py
+++ b/coverage/codeunit.py
@@ -52,7 +52,7 @@ class CodeUnit(object):
else:
f = morf
# .pyc files should always refer to a .py instead.
- if f.endswith('.pyc'):
+ if f.endswith('.pyc') or f.endswith('.pyo'):
f = f[:-1]
self.filename = self.file_locator.canonical_filename(f)