[pypy-svn] r13713 - pypy/dist/pypy/interpreter

mwh at codespeak.net mwh at codespeak.net
Thu Jun 23 15:30:33 CEST 2005


Author: mwh
Date: Thu Jun 23 15:30:32 2005
New Revision: 13713

Modified:
   pypy/dist/pypy/interpreter/nestedscope.py
Log:
yikes, don't do (non-const-string)%stuff


Modified: pypy/dist/pypy/interpreter/nestedscope.py
==============================================================================
--- pypy/dist/pypy/interpreter/nestedscope.py	(original)
+++ pypy/dist/pypy/interpreter/nestedscope.py	Thu Jun 23 15:30:32 2005
@@ -140,13 +140,13 @@
         except ValueError:
             varname = f.getfreevarname(varindex)
             if f.iscellvar(varindex):
-                message = "local variable '%s' referenced before assignment"
+                message = "local variable '%s' referenced before assignment"%varname
                 w_exc_type = f.space.w_UnboundLocalError
             else:
                 message = ("free variable '%s' referenced before assignment"
-                           " in enclosing scope")
+                           " in enclosing scope"%varname)
                 w_exc_type = f.space.w_NameError
-            raise OperationError(w_exc_type, f.space.wrap(message % varname))
+            raise OperationError(w_exc_type, f.space.wrap(message))
         else:
             f.valuestack.push(w_value)
 



More information about the Pypy-commit mailing list