diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2009-09-30 08:30:54 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2009-09-30 08:30:54 -0400 |
commit | efb089e1576eaa9326cce08978f81c25169850f2 (patch) | |
tree | de4b67ae8971b925e7a08a8cf93f3134c9d442b9 /coverage/files.py | |
parent | c7f90f9e930835a955df59bffe96e996dfcf11a0 (diff) | |
download | python-coveragepy-efb089e1576eaa9326cce08978f81c25169850f2.tar.gz |
Make egg source reading work on py2k and py3k, though i don't like it much...
Diffstat (limited to 'coverage/files.py')
-rw-r--r-- | coverage/files.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/coverage/files.py b/coverage/files.py index cce33c9..9bc8ac5 100644 --- a/coverage/files.py +++ b/coverage/files.py @@ -49,9 +49,9 @@ class FileLocator: def get_zip_data(self, filename): """Get data from `filename` if it is a zip file path. - Returns the data read from the zip file, or None if no zip file could - be found or `filename` isn't in it. The data returned might be "" if - the file is empty. + Returns the string data read from the zip file, or None if no zip file + could be found or `filename` isn't in it. The data returned will be + an empty string if the file is empty. """ import zipimport @@ -67,5 +67,7 @@ class FileLocator: data = zi.get_data(parts[1]) except IOError: continue + if sys.hexversion > 0x03000000: + data = data.decode('utf8') # TODO: How to do this properly? return data return None |