[pypy-svn] pypy interplevel-exception-classes: Kill parser/app_helpers.py; the exception is not used anyway :-/

amauryfa commits-noreply at bitbucket.org
Fri Feb 18 11:49:14 CET 2011


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: interplevel-exception-classes
Changeset: r42141:0aeb7d7f94ba
Date: 2011-02-18 11:19 +0100
http://bitbucket.org/pypy/pypy/changeset/0aeb7d7f94ba/

Log:	Kill parser/app_helpers.py; the exception is not used anyway :-/

diff --git a/pypy/module/parser/__init__.py b/pypy/module/parser/__init__.py
--- a/pypy/module/parser/__init__.py
+++ b/pypy/module/parser/__init__.py
@@ -7,7 +7,6 @@
      applevel_name = 'parser'
 
      appleveldefs = {
-         'ParserError' : 'app_helpers.ParserError'
          }
 
      interpleveldefs = {
@@ -25,5 +24,6 @@
          'ast2tuple'    : 'pyparser.st2tuple',
          'ASTType'      : 'pyparser.STType',
          'compilest'    : 'pyparser.compilest',
-         'compileast'   : 'pyparser.compilest'
+         'compileast'   : 'pyparser.compilest',
+         'ParserError'  : 'space.new_exception_class("parser.ParserError")',
          }

diff --git a/pypy/module/parser/test/test_parser.py b/pypy/module/parser/test/test_parser.py
--- a/pypy/module/parser/test/test_parser.py
+++ b/pypy/module/parser/test/test_parser.py
@@ -58,3 +58,6 @@
                      self.m.compilest(self.m.suite("x = 4"))):
             assert isinstance(code, types.CodeType)
             assert code.co_filename == "<syntax-tree>"
+
+    def test_error(self):
+        assert repr(self.m.ParserError) == "<class 'parser.ParserError'>"

diff --git a/pypy/module/parser/app_helpers.py b/pypy/module/parser/app_helpers.py
deleted file mode 100644
--- a/pypy/module/parser/app_helpers.py
+++ /dev/null
@@ -1,2 +0,0 @@
-class ParserError(Exception):
-    pass


More information about the Pypy-commit mailing list