Skip to content

Commit 825acb3

Browse files
committed
Where we deal with .pyc files, also deal with .pyo files. Fixes #195.
1 parent aef97b8 commit 825acb3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGES.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ Version 3.5.3b1
1818

1919
- Fixed memory leaks under Python 3, thanks, Brett Cannon.
2020

21+
- Optimized .pyo files may not have been handled correctly, `issue 195`_.
22+
Thanks, Marius Gedminas.
23+
2124
- Try to do a better job of the impossible task of detecting when we can't
2225
build the C extension, fixing `issue 183`_.
2326

@@ -26,9 +29,11 @@ Version 3.5.3b1
2629
.. _issue 82: https://bitbucket.org/ned/coveragepy/issue/82/tokenerror-when-generating-html-report
2730
.. _issue 179: https://bitbucket.org/ned/coveragepy/issue/179/htmlreporter-fails-when-source-file-is
2831
.. _issue 183: https://bitbucket.org/ned/coveragepy/issue/183/install-fails-for-python-23
32+
.. _issue 195: https://bitbucket.org/ned/coveragepy/issue/195/pyo-file-handling-in-codeunit
2933
.. _tox: http://tox.readthedocs.org/
3034

3135

36+
3237
Version 3.5.2 --- 4 May 2012
3338
----------------------------
3439

coverage/codeunit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def __init__(self, morf, file_locator):
5252
else:
5353
f = morf
5454
# .pyc files should always refer to a .py instead.
55-
if f.endswith('.pyc'):
55+
if f.endswith('.pyc') or f.endswith('.pyo'):
5656
f = f[:-1]
5757
self.filename = self.file_locator.canonical_filename(f)
5858

0 commit comments

Comments
 (0)