[pypy-commit] pypy py3k: Fix error message: exec() is a function now.

amauryfa noreply at buildbot.pypy.org
Mon Nov 19 23:51:33 CET 2012


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: py3k
Changeset: r59002:5bc5ca11f6f0
Date: 2012-11-19 16:49 +0100
http://bitbucket.org/pypy/pypy/changeset/5bc5ca11f6f0/

Log:	Fix error message: exec() is a function now.

diff --git a/pypy/interpreter/pyopcode.py b/pypy/interpreter/pyopcode.py
--- a/pypy/interpreter/pyopcode.py
+++ b/pypy/interpreter/pyopcode.py
@@ -1515,19 +1515,19 @@
 
         if not isinstance(globals, dict):
             raise TypeError(
-                "exec: arg 2 must be a dictionary or None, not %s" %
+                "exec() arg 2 must be a dictionary or None, not %s" %
                 type(globals).__name__)
         globals.setdefault('__builtins__', builtin)
         if not isinstance(locals, dict):
             if not hasattr(locals, '__getitem__'):
                 raise TypeError(
-                    "exec: arg 3 must be a mapping or None, not %s" %
+                    "exec() arg 3 must be a mapping or None, not %s" %
                     type(locals.__name__))
 
         if not isinstance(prog, codetype):
             filename = '<string>'
             if not isinstance(prog, (str, bytes)):
-                raise TypeError("exec: arg 1 must be a string, bytes, "
+                raise TypeError("exec() arg 1 must be a string, bytes, "
                                 "or code object")
             prog = compile(prog, filename, 'exec', compile_flags, 1)
         return (prog, globals, locals)


More information about the pypy-commit mailing list