[pypy-commit] pypy py3k: fix the error message

pjenvey pypy.commits at gmail.com
Fri May 27 15:28:15 EDT 2016


Author: Philip Jenvey <pjenvey at underboss.org>
Branch: py3k
Changeset: r84737:d48c62452f34
Date: 2016-05-27 12:27 -0700
http://bitbucket.org/pypy/pypy/changeset/d48c62452f34/

Log:	fix the error message

diff --git a/pypy/module/zipimport/interp_zipimport.py b/pypy/module/zipimport/interp_zipimport.py
--- a/pypy/module/zipimport/interp_zipimport.py
+++ b/pypy/module/zipimport/interp_zipimport.py
@@ -292,8 +292,8 @@
             # from the zlib module: let's to the same
             raise zlib_error(space, e.msg)
 
-    @unwrap_spec(fullname='fsencode')
-    def get_code(self, space, fullname):
+    def get_code(self, space, w_fullname):
+        fullname = space.fsencode_w(w_fullname)
         filename = self.make_filename(fullname)
         for compiled, _, ext in ENUMERATE_EXTS:
             if self.have_modulefile(space, filename + ext):
@@ -314,8 +314,8 @@
                         space, co_filename, source)
                 return space.wrap(code_w)
         raise oefmt(get_error(space),
-                    "Cannot find source or code for %s in %R",
-                    filename, space.wrap_fsdecoded(self.name))
+                    "Cannot find source or code for %R in %R",
+                    w_fullname, space.wrap_fsdecoded(self.name))
 
     @unwrap_spec(fullname='fsencode')
     def get_source(self, space, fullname):


More information about the pypy-commit mailing list