SF patch# 1766592 by Paul Colomiets.

Fix test_zipimport.
This commit is contained in:
Guido van Rossum 2007-08-03 18:40:49 +00:00
parent 6afaeb757a
commit ad8d30092c
4 changed files with 31 additions and 25 deletions

View file

@ -209,7 +209,7 @@ def _load_testfile(filename, package, module_relative):
filename = _module_relative_path(package, filename)
if hasattr(package, '__loader__'):
if hasattr(package.__loader__, 'get_data'):
return package.__loader__.get_data(filename), filename
return package.__loader__.get_data(filename).decode('utf-8'), filename
return open(filename, encoding="utf-8").read(), filename
def _indent(s, indent=4):