[pypy-svn] pypy compile-from-stream: Revert part of 3b843b81c6e6, to respect the comment just above

amauryfa commits-noreply at bitbucket.org
Mon Mar 21 21:47:43 CET 2011


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: compile-from-stream
Changeset: r42824:75f6b4394f19
Date: 2011-03-18 10:36 +0100
http://bitbucket.org/pypy/pypy/changeset/75f6b4394f19/

Log:	Revert part of 3b843b81c6e6, to respect the comment just above

diff --git a/pypy/interpreter/pyparser/pyparse.py b/pypy/interpreter/pyparser/pyparse.py
--- a/pypy/interpreter/pyparser/pyparse.py
+++ b/pypy/interpreter/pyparser/pyparse.py
@@ -119,11 +119,11 @@
                 try:
                     textsrc = recode_to_utf8(self.space, textsrc, enc)
                 except OperationError, e:
+                    space = self.space
                     # if the codec is not found, LookupError is raised.  we
                     # check using 'is_w' not to mask potential IndexError or
                     # KeyError
-                    space = self.space
-                    if e.match(space, space.w_LookupError):
+                    if space.is_w(e.w_type, space.w_LookupError):
                         raise error.SyntaxError("Unknown encoding: %s" % enc,
                                                 filename=compile_info.filename)
                     # Transform unicode errors into SyntaxError


More information about the Pypy-commit mailing list