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 | eb39082eff83d5d438be40b5254a712aebf0eeb5 (patch) | |
tree | f635d161f683e321791c8a4f9d45a9f33bf88e41 /coverage/files.py | |
parent | 168176ef145c81732aa1d98240955977eec547a7 (diff) | |
download | python-coveragepy-git-eb39082eff83d5d438be40b5254a712aebf0eeb5.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 cce33c97..9bc8ac5e 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 |