Author: Philip Jenvey <[email protected]>
Branch: py3k
Changeset: r64646:dcc9f87e4b91
Date: 2013-05-28 15:00 -0700
http://bitbucket.org/pypy/pypy/changeset/dcc9f87e4b91/

Log:    replace %8 w/ %R where possible

diff --git a/pypy/interpreter/pyopcode.py b/pypy/interpreter/pyopcode.py
--- a/pypy/interpreter/pyopcode.py
+++ b/pypy/interpreter/pyopcode.py
@@ -646,9 +646,8 @@
         # fall-back
         w_value = self._load_global(w_varname)
         if w_value is None:
-            message = "name '%8' is not defined"
-            raise operationerrfmt(self.space.w_NameError, message,
-                                  self.space.identifier_w(w_varname))
+            message = "name %R is not defined"
+            raise operationerrfmt(self.space.w_NameError, message, w_varname)
         self.pushvalue(w_value)
 
     def _load_global(self, w_varname):
@@ -661,9 +660,8 @@
     _load_global._always_inline_ = True
 
     def _load_global_failed(self, w_varname):
-        message = "global name '%8' is not defined"
-        raise operationerrfmt(self.space.w_NameError, message,
-                              self.space.identifier_w(w_varname))
+        message = "global name %R is not defined"
+        raise operationerrfmt(self.space.w_NameError, message, w_varname)
     _load_global_failed._dont_inline_ = True
 
     def LOAD_GLOBAL(self, nameindex, next_instr):
diff --git a/pypy/objspace/descroperation.py b/pypy/objspace/descroperation.py
--- a/pypy/objspace/descroperation.py
+++ b/pypy/objspace/descroperation.py
@@ -52,15 +52,14 @@
 
 def raiseattrerror(space, w_obj, w_name, w_descr=None):
     # space.repr always returns an encodable string.
-    name = space.str_w(space.repr(w_name))
     if w_descr is None:
         raise operationerrfmt(space.w_AttributeError,
-                              "'%T' object has no attribute %8",
-                              w_obj, name)
+                              "'%T' object has no attribute %R",
+                              w_obj, w_name)
     else:
         raise operationerrfmt(space.w_AttributeError,
-                              "'%T' object attribute %8 is read-only",
-                              w_obj, name)
+                              "'%T' object attribute %R is read-only",
+                              w_obj, w_name)
 
 def get_attribute_name(space, w_obj, w_name):
     try:
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to