[pypy-svn] r78188 - pypy/branch/fast-forward/pypy/module/exceptions

trundle at codespeak.net trundle at codespeak.net
Fri Oct 22 00:00:17 CEST 2010


Author: trundle
Date: Fri Oct 22 00:00:15 2010
New Revision: 78188

Modified:
   pypy/branch/fast-forward/pypy/module/exceptions/__init__.py
   pypy/branch/fast-forward/pypy/module/exceptions/interp_exceptions.py
Log:
Add BufferError, make GeneratorExit inherit from BaseException and update
exception hierarchy in docstring.

test_pep352 passes now.


Modified: pypy/branch/fast-forward/pypy/module/exceptions/__init__.py
==============================================================================
--- pypy/branch/fast-forward/pypy/module/exceptions/__init__.py	(original)
+++ pypy/branch/fast-forward/pypy/module/exceptions/__init__.py	Fri Oct 22 00:00:15 2010
@@ -9,6 +9,7 @@
         'AssertionError' : 'interp_exceptions.W_AssertionError',
         'AttributeError' : 'interp_exceptions.W_AttributeError',
         'BaseException' : 'interp_exceptions.W_BaseException',
+        'BufferError' : 'interp_exceptions.W_BufferError',
         'BytesWarning'  : 'interp_exceptions.W_BytesWarning',
         'DeprecationWarning' : 'interp_exceptions.W_DeprecationWarning',
         'EOFError' : 'interp_exceptions.W_EOFError',

Modified: pypy/branch/fast-forward/pypy/module/exceptions/interp_exceptions.py
==============================================================================
--- pypy/branch/fast-forward/pypy/module/exceptions/interp_exceptions.py	(original)
+++ pypy/branch/fast-forward/pypy/module/exceptions/interp_exceptions.py	Fri Oct 22 00:00:15 2010
@@ -23,10 +23,11 @@
 BaseException
  +-- SystemExit
  +-- KeyboardInterrupt
+ +-- GeneratorExit
  +-- Exception
-      +-- GeneratorExit
       +-- StopIteration
       +-- StandardError
+      |    +-- BufferError
       |    +-- ArithmeticError
       |    |    +-- FloatingPointError
       |    |    +-- OverflowError
@@ -55,20 +56,20 @@
       |    +-- SystemError
       |    +-- TypeError
       |    +-- ValueError
-      |    |    +-- UnicodeError
-      |    |         +-- UnicodeDecodeError
-      |    |         +-- UnicodeEncodeError
-      |    |         +-- UnicodeTranslateError
+      |         +-- UnicodeError
+      |              +-- UnicodeDecodeError
+      |              +-- UnicodeEncodeError
+      |              +-- UnicodeTranslateError
       +-- Warning
-           +-- BytesWarning
            +-- DeprecationWarning
            +-- PendingDeprecationWarning
            +-- RuntimeWarning
            +-- SyntaxWarning
            +-- UserWarning
            +-- FutureWarning
-           +-- ImportWarning
-           +-- UnicodeWarning
+	   +-- ImportWarning
+	   +-- UnicodeWarning
+	   +-- BytesWarning
 """
 
 from pypy.interpreter.baseobjspace import ObjSpace, Wrappable, W_Root
@@ -262,12 +263,15 @@
 W_Exception = _new_exception('Exception', W_BaseException,
                          """Common base class for all non-exit exceptions.""")
 
-W_GeneratorExit = _new_exception('GeneratorExit', W_Exception,
+W_GeneratorExit = _new_exception('GeneratorExit', W_BaseException,
                           """Request that a generator exit.""")
 
 W_StandardError = _new_exception('StandardError', W_Exception,
                          """Base class for all standard Python exceptions.""")
 
+W_BufferError = _new_exception('BufferError', W_StandardError,
+                         """Buffer error.""")
+
 W_ValueError = _new_exception('ValueError', W_StandardError,
                          """Inappropriate argument value (of correct type).""")
 



More information about the Pypy-commit mailing list