[pypy-svn] r8680 - in pypy/dist/pypy: lib module objspace/std tool translator

tismer at codespeak.net tismer at codespeak.net
Sat Jan 29 01:44:32 CET 2005


Author: tismer
Date: Sat Jan 29 01:44:32 2005
New Revision: 8680

Modified:
   pypy/dist/pypy/lib/_exceptions.py
   pypy/dist/pypy/module/exceptionsinterp.py
   pypy/dist/pypy/objspace/std/objspace.py
   pypy/dist/pypy/tool/_enum_exceptions.py
   pypy/dist/pypy/tool/sourcetools.py
   pypy/dist/pypy/translator/geninterplevel.py
Log:
module docstrings are now fully supported.
They appear in _exceptions.py and are transported
to the generated exceptionsinterp.py .

Modified: pypy/dist/pypy/lib/_exceptions.py
==============================================================================
--- pypy/dist/pypy/lib/_exceptions.py	(original)
+++ pypy/dist/pypy/lib/_exceptions.py	Sat Jan 29 01:44:32 2005
@@ -1,3 +1,92 @@
+"""Python's standard exception class hierarchy.
+
+Before Python 1.5, the standard exceptions were all simple string objects.
+In Python 1.5, the standard exceptions were converted to classes organized
+into a relatively flat hierarchy.  String-based standard exceptions were
+optional, or used as a fallback if some problem occurred while importing
+the exception module.  With Python 1.6, optional string-based standard
+exceptions were removed (along with the -X command line flag).
+
+The class exceptions were implemented in such a way as to be almost
+completely backward compatible.  Some tricky uses of IOError could
+potentially have broken, but by Python 1.6, all of these should have
+been fixed.  As of Python 1.6, the class-based standard exceptions are
+now implemented in C, and are guaranteed to exist in the Python
+interpreter.
+
+Here is a rundown of the class hierarchy.  The classes found here are
+inserted into both the exceptions module and the `built-in' module.  It is
+recommended that user defined class based exceptions be derived from the
+`Exception' class, although this is currently not enforced.
+
+Exception
+ |
+ +-- SystemExit
+ +-- TaskletExit
+ +-- StopIteration
+ +-- StandardError
+ |    |
+ |    +-- KeyboardInterrupt
+ |    +-- ImportError
+ |    +-- EnvironmentError
+ |    |    |
+ |    |    +-- IOError
+ |    |    +-- OSError
+ |    |         |
+ |    |         +-- WindowsError
+ |    |         +-- VMSError
+ |    |
+ |    +-- EOFError
+ |    +-- RuntimeError
+ |    |    |
+ |    |    +-- NotImplementedError
+ |    |
+ |    +-- NameError
+ |    |    |
+ |    |    +-- UnboundLocalError
+ |    |
+ |    +-- AttributeError
+ |    +-- SyntaxError
+ |    |    |
+ |    |    +-- IndentationError
+ |    |         |
+ |    |         +-- TabError
+ |    |
+ |    +-- TypeError
+ |    +-- AssertionError
+ |    +-- LookupError
+ |    |    |
+ |    |    +-- IndexError
+ |    |    +-- KeyError
+ |    |
+ |    +-- ArithmeticError
+ |    |    |
+ |    |    +-- OverflowError
+ |    |    +-- ZeroDivisionError
+ |    |    +-- FloatingPointError
+ |    |
+ |    +-- ValueError
+ |    |    |
+ |    |    +-- UnicodeError
+ |    |        |
+ |    |        +-- UnicodeEncodeError
+ |    |        +-- UnicodeDecodeError
+ |    |        +-- UnicodeTranslateError
+ |    |
+ |    +-- ReferenceError
+ |    +-- SystemError
+ |    +-- MemoryError
+ |
+ +---Warning
+      |
+      +-- UserWarning
+      +-- DeprecationWarning
+      +-- PendingDeprecationWarning
+      +-- SyntaxWarning
+      +-- OverflowWarning
+      +-- RuntimeWarning
+      +-- FutureWarning"""
+
 class Exception:
     """Common base class for all exceptions."""
 
@@ -295,4 +384,3 @@
 
 class WindowsError(OSError):
     """MS-Windows OS system call failed."""
-

Modified: pypy/dist/pypy/module/exceptionsinterp.py
==============================================================================
--- pypy/dist/pypy/module/exceptionsinterp.py	(original)
+++ pypy/dist/pypy/module/exceptionsinterp.py	Sat Jan 29 01:44:32 2005
@@ -1,9 +1,99 @@
 #!/bin/env python
 # -*- coding: LATIN-1 -*-
+
+"""Python's standard exception class hierarchy.
+
+Before Python 1.5, the standard exceptions were all simple string objects.
+In Python 1.5, the standard exceptions were converted to classes organized
+into a relatively flat hierarchy.  String-based standard exceptions were
+optional, or used as a fallback if some problem occurred while importing
+the exception module.  With Python 1.6, optional string-based standard
+exceptions were removed (along with the -X command line flag).
+
+The class exceptions were implemented in such a way as to be almost
+completely backward compatible.  Some tricky uses of IOError could
+potentially have broken, but by Python 1.6, all of these should have
+been fixed.  As of Python 1.6, the class-based standard exceptions are
+now implemented in C, and are guaranteed to exist in the Python
+interpreter.
+
+Here is a rundown of the class hierarchy.  The classes found here are
+inserted into both the exceptions module and the `built-in' module.  It is
+recommended that user defined class based exceptions be derived from the
+`Exception' class, although this is currently not enforced.
+
+Exception
+ |
+ +-- SystemExit
+ +-- TaskletExit
+ +-- StopIteration
+ +-- StandardError
+ |    |
+ |    +-- KeyboardInterrupt
+ |    +-- ImportError
+ |    +-- EnvironmentError
+ |    |    |
+ |    |    +-- IOError
+ |    |    +-- OSError
+ |    |         |
+ |    |         +-- WindowsError
+ |    |         +-- VMSError
+ |    |
+ |    +-- EOFError
+ |    +-- RuntimeError
+ |    |    |
+ |    |    +-- NotImplementedError
+ |    |
+ |    +-- NameError
+ |    |    |
+ |    |    +-- UnboundLocalError
+ |    |
+ |    +-- AttributeError
+ |    +-- SyntaxError
+ |    |    |
+ |    |    +-- IndentationError
+ |    |         |
+ |    |         +-- TabError
+ |    |
+ |    +-- TypeError
+ |    +-- AssertionError
+ |    +-- LookupError
+ |    |    |
+ |    |    +-- IndexError
+ |    |    +-- KeyError
+ |    |
+ |    +-- ArithmeticError
+ |    |    |
+ |    |    +-- OverflowError
+ |    |    +-- ZeroDivisionError
+ |    |    +-- FloatingPointError
+ |    |
+ |    +-- ValueError
+ |    |    |
+ |    |    +-- UnicodeError
+ |    |        |
+ |    |        +-- UnicodeEncodeError
+ |    |        +-- UnicodeDecodeError
+ |    |        +-- UnicodeTranslateError
+ |    |
+ |    +-- ReferenceError
+ |    +-- SystemError
+ |    +-- MemoryError
+ |
+ +---Warning
+      |
+      +-- UserWarning
+      +-- DeprecationWarning
+      +-- PendingDeprecationWarning
+      +-- SyntaxWarning
+      +-- OverflowWarning
+      +-- RuntimeWarning
+      +-- FutureWarning"""
+
 ##SECTION##
-## filename    '/home/arigo/svn/pypy/dist/pypy/appspace/_exceptions.py'
+## filename    'D:\\pypy\\dist\\pypy\\lib\\_exceptions.py'
 ## function    '__getitem__'
-## firstlineno 5
+## firstlineno 94
 ##SECTION##
 def __getitem__(space, *args_w):
     kwlist = ["self", "idx"]
@@ -16,7 +106,7 @@
 
 def __getitem__(space, w_self_1, w_idx_3):
 
-    w_0=w_0=w_2=w_4=None
+    w_0=w_2=w_4=None
 
     goto = 1 # startblock
     while True:
@@ -32,9 +122,9 @@
 fastf_Exception___getitem__ = globals().pop("__getitem__")
 
 ##SECTION##
-## filename    '/home/arigo/svn/pypy/dist/pypy/appspace/_exceptions.py'
+## filename    'D:\\pypy\\dist\\pypy\\lib\\_exceptions.py'
 ## function    '__init__'
-## firstlineno 9
+## firstlineno 98
 ##SECTION##
 def __init__(space, *args_w):
     kwlist = ["self"]
@@ -48,7 +138,7 @@
 
 def __init__(space, w_self_1, w_args_2):
 
-    w_0=w_0=w_3=None
+    w_0=w_3=None
 
     goto = 1 # startblock
     while True:
@@ -63,9 +153,9 @@
 fastf_Exception___init__ = globals().pop("__init__")
 
 ##SECTION##
-## filename    '/home/arigo/svn/pypy/dist/pypy/appspace/_exceptions.py'
+## filename    'D:\\pypy\\dist\\pypy\\lib\\_exceptions.py'
 ## function    '__str__'
-## firstlineno 13
+## firstlineno 102
 ##SECTION##
 # global declarations
 # global object gs_args
@@ -83,9 +173,9 @@
 
 def __str__(space, w_self_1):
 
-    w_0=w_0=w_argc_2=w_3=v4=w_self_6=w_argc_7=w_8=w_9=v10=w_self_16=None
-    w_argc_17=w_argc_17=w_18=w_22=w_23=w_5=w_self_11=w_argc_12=w_13=None
-    w_14=w_14=w_15=w_19=w_20=w_21=None
+    w_0=w_argc_2=w_3=v4=w_self_6=w_argc_7=w_8=w_9=v10=w_self_16=w_argc_17=None
+    w_18=w_22=w_23=w_5=w_self_11=w_argc_12=w_13=w_14=w_15=w_19=w_20=None
+    w_21=None
 
     goto = 1 # startblock
     while True:
@@ -135,9 +225,9 @@
 fastf_Exception___str__ = globals().pop("__str__")
 
 ##SECTION##
-## filename    '/home/arigo/svn/pypy/dist/pypy/appspace/_exceptions.py'
+## filename    'D:\\pypy\\dist\\pypy\\lib\\_exceptions.py'
 ## function    '__init__'
-## firstlineno 41
+## firstlineno 130
 ##SECTION##
 # global declarations
 # global object gi_4
@@ -156,8 +246,8 @@
 
 def __init__(space, w_self_3, w_args_1):
 
-    w_argc_0=w_argc_0=w_2=w_4=v5=w_12=w_self_6=w_args_7=w_argc_8=None
-    w_9=w_9=w_10=w_11=w_13=w_14=w_15=w_16=w_17=w_18=w_19=w_20=None
+    w_argc_0=w_2=w_4=v5=w_12=w_self_6=w_args_7=w_argc_8=w_9=w_10=None
+    w_11=w_13=w_14=w_15=w_16=w_17=w_18=w_19=w_20=None
 
     goto = 1 # startblock
     while True:
@@ -193,9 +283,9 @@
 fastf_UnicodeTranslateError___init__ = globals().pop("__init__")
 
 ##SECTION##
-## filename    '/home/arigo/svn/pypy/dist/pypy/appspace/_exceptions.py'
+## filename    'D:\\pypy\\dist\\pypy\\lib\\_exceptions.py'
 ## function    '__str__'
-## firstlineno 51
+## firstlineno 140
 ##SECTION##
 # global declarations
 # global object gs_start
@@ -222,8 +312,8 @@
 
 def __str__(space, w_self_1):
 
-    w_0=w_0=w_2=w_3=w_4=w_5=w_6=w_7=w_8=w_9=w_10=w_11=w_12=w_13=w_14=None
-    w_15=w_15=w_16=w_res_17=w_18=None
+    w_0=w_2=w_3=w_4=w_5=w_6=w_7=w_8=w_9=w_10=w_11=w_12=w_13=w_14=None
+    w_15=w_16=w_res_17=w_18=None
 
     goto = 1 # startblock
     while True:
@@ -260,9 +350,9 @@
 fastf_UnicodeTranslateError___str__ = globals().pop("__str__")
 
 ##SECTION##
-## filename    '/home/arigo/svn/pypy/dist/pypy/appspace/_exceptions.py'
+## filename    'D:\\pypy\\dist\\pypy\\lib\\_exceptions.py'
 ## function    '__str__'
-## firstlineno 69
+## firstlineno 158
 ##SECTION##
 def __str__(space, *args_w):
     kwlist = ["self"]
@@ -275,9 +365,9 @@
 
 def __str__(space, w_self_1):
 
-    w_0=w_0=w_argc_2=w_3=v4=w_self_6=w_argc_7=w_8=w_9=v10=w_self_16=None
-    w_argc_17=w_argc_17=w_18=w_22=w_23=w_5=w_self_11=w_argc_12=w_13=None
-    w_14=w_14=w_15=w_19=w_20=w_21=None
+    w_0=w_argc_2=w_3=v4=w_self_6=w_argc_7=w_8=w_9=v10=w_self_16=w_argc_17=None
+    w_18=w_22=w_23=w_5=w_self_11=w_argc_12=w_13=w_14=w_15=w_19=w_20=None
+    w_21=None
 
     goto = 1 # startblock
     while True:
@@ -326,9 +416,9 @@
 fastf_KeyError___str__ = globals().pop("__str__")
 
 ##SECTION##
-## filename    '/home/arigo/svn/pypy/dist/pypy/appspace/_exceptions.py'
+## filename    'D:\\pypy\\dist\\pypy\\lib\\_exceptions.py'
 ## function    '__init__'
-## firstlineno 91
+## firstlineno 183
 ##SECTION##
 def __init__(space, *args_w):
     kwlist = ["self"]
@@ -342,12 +432,11 @@
 
 def __init__(space, w_self_3, w_args_1):
 
-    w_argc_0=w_argc_0=w_2=w_4=w_5=w_6=w_7=v8=w_self_18=w_args_19=None
-    w_argc_20=w_argc_20=w_21=v23=w_self_29=w_args_30=w_argc_31=w_36=None
-    v37=v37=w_43=w_self_38=w_args_39=w_argc_40=w_41=w_42=w_44=w_45=None
-    w_46=w_46=w_47=w_48=w_49=w_self_24=w_args_25=w_argc_26=w_27=w_28=None
-    w_32=w_32=w_33=w_34=w_35=w_self_9=w_args_10=w_argc_11=w_12=w_13=None
-    w_14=w_14=w_15=w_16=w_17=w_22=None
+    w_argc_0=w_2=w_4=w_5=w_6=w_7=v8=w_self_18=w_args_19=w_argc_20=None
+    w_21=v23=w_self_29=w_args_30=w_argc_31=w_36=v37=w_43=w_self_38=None
+    w_args_39=w_argc_40=w_41=w_42=w_44=w_45=w_46=w_47=w_48=w_49=w_self_24=None
+    w_args_25=w_argc_26=w_27=w_28=w_32=w_33=w_34=w_35=w_self_9=w_args_10=None
+    w_argc_11=w_12=w_13=w_14=w_15=w_16=w_17=w_22=None
 
     goto = 1 # startblock
     while True:
@@ -423,9 +512,9 @@
 fastf_EnvironmentError___init__ = globals().pop("__init__")
 
 ##SECTION##
-## filename    '/home/arigo/svn/pypy/dist/pypy/appspace/_exceptions.py'
+## filename    'D:\\pypy\\dist\\pypy\\lib\\_exceptions.py'
 ## function    '__str__'
-## firstlineno 105
+## firstlineno 197
 ##SECTION##
 # global declarations
 # global object gs_errno
@@ -433,7 +522,6 @@
 # global object gs_strerror
 # global object gs_strerror_
 # global object gs_filename_
-# global object gbltinmethod_join_1
 
 def __str__(space, *args_w):
     kwlist = ["self"]
@@ -446,8 +534,8 @@
 
 def __str__(space, w_self_1):
 
-    w_0=w_0=w_2=w_3=w_4=w_5=w_6=w_7=w_8=w_9=w_10=w_11=w_12=w_13=w_res_14=None
-    w_15=w_15=None
+    w_0=w_2=w_3=w_4=w_5=w_6=w_7=w_8=w_9=w_10=w_11=w_12=w_13=w_res_14=None
+    w_15=None
 
     goto = 1 # startblock
     while True:
@@ -471,7 +559,7 @@
             w_12 = space.add(gs_filename_, w_11)
             w_13 = space.newlist([w_3, w_6, w_9, w_12])
             _tup = space.newtuple([w_13])
-            w_res_14 = space.call(gbltinmethod_join_1, _tup)
+            w_res_14 = space.call(gbltinmethod_join, _tup)
             w_15 = w_res_14
             goto = 2
 
@@ -480,9 +568,128 @@
 fastf_EnvironmentError___str__ = globals().pop("__str__")
 
 ##SECTION##
-## filename    '/home/arigo/svn/pypy/dist/pypy/appspace/_exceptions.py'
+## filename    'D:\\pypy\\dist\\pypy\\lib\\_exceptions.py'
+## function    '__init__'
+## firstlineno 217
+##SECTION##
+# global declaration
+# global object gi_5
+
+def __init__(space, *args_w):
+    kwlist = ["self"]
+    w_args_1 = space.newtuple(list(args_w[1:]))
+    _args_w = args_w[:1]
+    defaults_w = ()
+    funcname = "__init__"
+    w_self_3, = PyArg_ParseMini(space, funcname, 1, 1, _args_w, defaults_w)
+    return fastf_UnicodeEncodeError___init__(space, w_self_3, w_args_1)
+f_UnicodeEncodeError___init__ = globals().pop("__init__")
+
+def __init__(space, w_self_3, w_args_1):
+
+    w_argc_0=w_2=w_4=v5=w_12=w_self_6=w_args_7=w_argc_8=w_9=w_10=None
+    w_11=w_13=w_14=w_15=w_16=w_17=w_18=w_19=w_20=w_21=w_22=None
+
+    goto = 1 # startblock
+    while True:
+
+        if goto == 1:
+            w_argc_0 = space.len(w_args_1)
+            w_2 = space.setattr(w_self_3, gs_args, w_args_1)
+            w_4 = space.eq(w_argc_0, gi_5)
+            v5 = space.is_true(w_4)
+            if v5 == True:
+                (w_self_6, w_args_7, w_argc_8, w_9, w_10, w_11) = (w_self_3,
+                 w_args_1, w_argc_0, w_2, w_4, v5)
+                goto = 2
+            else:
+                assert v5 == False
+                w_12 = space.w_None
+                goto = 3
+
+        if goto == 2:
+            w_13 = space.getitem(w_args_7, gi_0)
+            w_14 = space.setattr(w_self_6, gs_encoding, w_13)
+            w_15 = space.getitem(w_args_7, gi_1)
+            w_16 = space.setattr(w_self_6, gs_object, w_15)
+            w_17 = space.getitem(w_args_7, gi_2)
+            w_18 = space.setattr(w_self_6, gs_start, w_17)
+            w_19 = space.getitem(w_args_7, gi_3)
+            w_20 = space.setattr(w_self_6, gs_end, w_19)
+            w_21 = space.getitem(w_args_7, gi_4)
+            w_22 = space.setattr(w_self_6, gs_reason, w_21)
+            w_12 = space.w_None
+            goto = 3
+
+        if goto == 3:
+            return w_12
+fastf_UnicodeEncodeError___init__ = globals().pop("__init__")
+
+##SECTION##
+## filename    'D:\\pypy\\dist\\pypy\\lib\\_exceptions.py'
+## function    '__str__'
+## firstlineno 228
+##SECTION##
+# global declarations
+# global object gs_encoding
+# global object gs_encoding_
+
+def __str__(space, *args_w):
+    kwlist = ["self"]
+    _args_w = args_w
+    defaults_w = ()
+    funcname = "__str__"
+    w_self_1, = PyArg_ParseMini(space, funcname, 1, 1, _args_w, defaults_w)
+    return fastf_UnicodeEncodeError___str__(space, w_self_1)
+f_UnicodeEncodeError___str__ = globals().pop("__str__")
+
+def __str__(space, w_self_1):
+
+    w_0=w_2=w_3=w_4=w_5=w_6=w_7=w_8=w_9=w_10=w_11=w_12=w_13=w_14=None
+    w_15=w_16=w_17=w_18=w_19=w_res_20=w_21=None
+
+    goto = 1 # startblock
+    while True:
+
+        if goto == 1:
+            w_0 = space.getattr(w_self_1, gs_object)
+            _tup = space.newtuple([w_0])
+            w_2 = space.call(space.w_str, _tup)
+            w_3 = space.add(gs_object_, w_2)
+            w_4 = space.getattr(w_self_1, gs_end)
+            _tup = space.newtuple([w_4])
+            w_5 = space.call(space.w_str, _tup)
+            w_6 = space.add(gs_end_, w_5)
+            w_7 = space.getattr(w_self_1, gs_encoding)
+            _tup = space.newtuple([w_7])
+            w_8 = space.call(space.w_str, _tup)
+            w_9 = space.add(gs_encoding_, w_8)
+            w_10 = space.getattr(w_self_1, gs_args)
+            _tup = space.newtuple([w_10])
+            w_11 = space.call(space.w_str, _tup)
+            w_12 = space.add(gs_args_, w_11)
+            w_13 = space.getattr(w_self_1, gs_start)
+            _tup = space.newtuple([w_13])
+            w_14 = space.call(space.w_str, _tup)
+            w_15 = space.add(gs_start_, w_14)
+            w_16 = space.getattr(w_self_1, gs_reason)
+            _tup = space.newtuple([w_16])
+            w_17 = space.call(space.w_str, _tup)
+            w_18 = space.add(gs_reason_, w_17)
+            w_19 = space.newlist([w_3, w_6, w_9, w_12, w_15, w_18])
+            _tup = space.newtuple([w_19])
+            w_res_20 = space.call(gbltinmethod_join, _tup)
+            w_21 = w_res_20
+            goto = 2
+
+        if goto == 2:
+            return w_21
+fastf_UnicodeEncodeError___str__ = globals().pop("__str__")
+
+##SECTION##
+## filename    'D:\\pypy\\dist\\pypy\\lib\\_exceptions.py'
 ## function    '__init__'
-## firstlineno 149
+## firstlineno 268
 ##SECTION##
 def __init__(space, *args_w):
     kwlist = ["self"]
@@ -496,10 +703,10 @@
 
 def __init__(space, w_self_3, w_args_1):
 
-    w_argc_0=w_argc_0=w_2=w_4=v5=w_self_12=w_args_13=w_argc_14=w_17=None
-    v18=v18=w_24=w_self_19=w_args_20=w_argc_21=w_22=w_23=w_25=w_26=None
-    w_27=w_27=w_28=w_29=w_30=w_31=w_32=w_33=w_34=w_35=w_36=w_self_6=None
-    w_args_7=w_args_7=w_argc_8=w_9=w_10=w_11=w_15=w_16=None
+    w_argc_0=w_2=w_4=v5=w_self_12=w_args_13=w_argc_14=w_17=v18=w_24=None
+    w_self_19=w_args_20=w_argc_21=w_22=w_23=w_25=w_26=w_27=w_28=w_29=None
+    w_30=w_31=w_32=w_33=w_34=w_35=w_36=w_self_6=w_args_7=w_argc_8=None
+    w_9=w_10=w_11=w_15=w_16=None
 
     goto = 1 # startblock
     while True:
@@ -557,13 +764,10 @@
 fastf_SyntaxError___init__ = globals().pop("__init__")
 
 ##SECTION##
-## filename    '/home/arigo/svn/pypy/dist/pypy/appspace/_exceptions.py'
+## filename    'D:\\pypy\\dist\\pypy\\lib\\_exceptions.py'
 ## function    '__str__'
-## firstlineno 161
+## firstlineno 280
 ##SECTION##
-# global declaration
-# global object gbltinmethod_join_2
-
 def __str__(space, *args_w):
     kwlist = ["self"]
     _args_w = args_w
@@ -575,7 +779,7 @@
 
 def __str__(space, w_self_1):
 
-    w_0=w_0=w_2=w_3=w_4=w_res_5=w_6=None
+    w_0=w_2=w_3=w_4=w_res_5=w_6=None
 
     goto = 1 # startblock
     while True:
@@ -587,7 +791,7 @@
             w_3 = space.add(gs_args_, w_2)
             w_4 = space.newlist([w_3])
             _tup = space.newtuple([w_4])
-            w_res_5 = space.call(gbltinmethod_join_2, _tup)
+            w_res_5 = space.call(gbltinmethod_join, _tup)
             w_6 = w_res_5
             goto = 2
 
@@ -596,9 +800,9 @@
 fastf_SyntaxError___str__ = globals().pop("__str__")
 
 ##SECTION##
-## filename    '/home/arigo/svn/pypy/dist/pypy/appspace/_exceptions.py'
+## filename    'D:\\pypy\\dist\\pypy\\lib\\_exceptions.py'
 ## function    '__init__'
-## firstlineno 175
+## firstlineno 294
 ##SECTION##
 # global declaration
 # global object gs_code
@@ -615,11 +819,10 @@
 
 def __init__(space, w_self_4, w_args_1):
 
-    w_argc_0=w_argc_0=w_2=v3=w_self_10=w_args_11=w_argc_12=w_14=w_15=None
-    v16=v16=w_self_23=w_args_24=w_argc_25=w_28=v29=w_35=w_self_30=None
-    w_args_31=w_args_31=w_argc_32=w_33=w_34=w_36=w_self_17=w_args_18=None
-    w_argc_19=w_argc_19=w_20=w_21=w_22=w_26=w_27=w_self_5=w_args_6=None
-    w_argc_7=w_argc_7=w_8=w_9=w_13=None
+    w_argc_0=w_2=v3=w_self_10=w_args_11=w_argc_12=w_14=w_15=v16=w_self_23=None
+    w_args_24=w_argc_25=w_28=v29=w_35=w_self_30=w_args_31=w_argc_32=None
+    w_33=w_34=w_36=w_self_17=w_args_18=w_argc_19=w_20=w_21=w_22=w_26=None
+    w_27=w_self_5=w_args_6=w_argc_7=w_8=w_9=w_13=None
 
     goto = 1 # startblock
     while True:
@@ -683,9 +886,9 @@
 fastf_SystemExit___init__ = globals().pop("__init__")
 
 ##SECTION##
-## filename    '/home/arigo/svn/pypy/dist/pypy/appspace/_exceptions.py'
+## filename    'D:\\pypy\\dist\\pypy\\lib\\_exceptions.py'
 ## function    '__init__'
-## firstlineno 210
+## firstlineno 329
 ##SECTION##
 def __init__(space, *args_w):
     kwlist = ["self"]
@@ -699,9 +902,8 @@
 
 def __init__(space, w_self_3, w_args_1):
 
-    w_argc_0=w_argc_0=w_2=w_4=v5=w_12=w_self_6=w_args_7=w_argc_8=None
-    w_9=w_9=w_10=w_11=w_13=w_14=w_15=w_16=w_17=w_18=w_19=w_20=w_21=None
-    w_22=w_22=None
+    w_argc_0=w_2=w_4=v5=w_12=w_self_6=w_args_7=w_argc_8=w_9=w_10=None
+    w_11=w_13=w_14=w_15=w_16=w_17=w_18=w_19=w_20=w_21=w_22=None
 
     goto = 1 # startblock
     while True:
@@ -739,13 +941,10 @@
 fastf_UnicodeDecodeError___init__ = globals().pop("__init__")
 
 ##SECTION##
-## filename    '/home/arigo/svn/pypy/dist/pypy/appspace/_exceptions.py'
+## filename    'D:\\pypy\\dist\\pypy\\lib\\_exceptions.py'
 ## function    '__str__'
-## firstlineno 221
+## firstlineno 340
 ##SECTION##
-# global declaration
-# global object gbltinmethod_join_4
-
 def __str__(space, *args_w):
     kwlist = ["self"]
     _args_w = args_w
@@ -757,8 +956,8 @@
 
 def __str__(space, w_self_1):
 
-    w_0=w_0=w_2=w_3=w_4=w_5=w_6=w_7=w_8=w_9=w_10=w_11=w_12=w_13=w_14=None
-    w_15=w_15=w_16=w_17=w_18=w_19=w_res_20=w_21=None
+    w_0=w_2=w_3=w_4=w_5=w_6=w_7=w_8=w_9=w_10=w_11=w_12=w_13=w_14=None
+    w_15=w_16=w_17=w_18=w_19=w_res_20=w_21=None
 
     goto = 1 # startblock
     while True:
@@ -790,7 +989,7 @@
             w_18 = space.add(gs_reason_, w_17)
             w_19 = space.newlist([w_3, w_6, w_9, w_12, w_15, w_18])
             _tup = space.newtuple([w_19])
-            w_res_20 = space.call(gbltinmethod_join_4, _tup)
+            w_res_20 = space.call(gbltinmethod_join, _tup)
             w_21 = w_res_20
             goto = 2
 
@@ -799,135 +998,14 @@
 fastf_UnicodeDecodeError___str__ = globals().pop("__str__")
 
 ##SECTION##
-## filename    '/home/arigo/svn/pypy/dist/pypy/appspace/_exceptions.py'
-## function    '__init__'
-## firstlineno 270
-##SECTION##
-# global declaration
-# global object gi_5
-
-def __init__(space, *args_w):
-    kwlist = ["self"]
-    w_args_1 = space.newtuple(list(args_w[1:]))
-    _args_w = args_w[:1]
-    defaults_w = ()
-    funcname = "__init__"
-    w_self_3, = PyArg_ParseMini(space, funcname, 1, 1, _args_w, defaults_w)
-    return fastf_UnicodeEncodeError___init__(space, w_self_3, w_args_1)
-f_UnicodeEncodeError___init__ = globals().pop("__init__")
-
-def __init__(space, w_self_3, w_args_1):
-
-    w_argc_0=w_argc_0=w_2=w_4=v5=w_12=w_self_6=w_args_7=w_argc_8=None
-    w_9=w_9=w_10=w_11=w_13=w_14=w_15=w_16=w_17=w_18=w_19=w_20=w_21=None
-    w_22=w_22=None
-
-    goto = 1 # startblock
-    while True:
-
-        if goto == 1:
-            w_argc_0 = space.len(w_args_1)
-            w_2 = space.setattr(w_self_3, gs_args, w_args_1)
-            w_4 = space.eq(w_argc_0, gi_5)
-            v5 = space.is_true(w_4)
-            if v5 == True:
-                (w_self_6, w_args_7, w_argc_8, w_9, w_10, w_11) = (w_self_3,
-                 w_args_1, w_argc_0, w_2, w_4, v5)
-                goto = 2
-            else:
-                assert v5 == False
-                w_12 = space.w_None
-                goto = 3
-
-        if goto == 2:
-            w_13 = space.getitem(w_args_7, gi_0)
-            w_14 = space.setattr(w_self_6, gs_encoding, w_13)
-            w_15 = space.getitem(w_args_7, gi_1)
-            w_16 = space.setattr(w_self_6, gs_object, w_15)
-            w_17 = space.getitem(w_args_7, gi_2)
-            w_18 = space.setattr(w_self_6, gs_start, w_17)
-            w_19 = space.getitem(w_args_7, gi_3)
-            w_20 = space.setattr(w_self_6, gs_end, w_19)
-            w_21 = space.getitem(w_args_7, gi_4)
-            w_22 = space.setattr(w_self_6, gs_reason, w_21)
-            w_12 = space.w_None
-            goto = 3
-
-        if goto == 3:
-            return w_12
-fastf_UnicodeEncodeError___init__ = globals().pop("__init__")
-
-##SECTION##
-## filename    '/home/arigo/svn/pypy/dist/pypy/appspace/_exceptions.py'
-## function    '__str__'
-## firstlineno 281
-##SECTION##
-# global declarations
-# global object gs_encoding
-# global object gs_encoding_
-# global object gbltinmethod_join_3
-
-def __str__(space, *args_w):
-    kwlist = ["self"]
-    _args_w = args_w
-    defaults_w = ()
-    funcname = "__str__"
-    w_self_1, = PyArg_ParseMini(space, funcname, 1, 1, _args_w, defaults_w)
-    return fastf_UnicodeEncodeError___str__(space, w_self_1)
-f_UnicodeEncodeError___str__ = globals().pop("__str__")
-
-def __str__(space, w_self_1):
-
-    w_0=w_0=w_2=w_3=w_4=w_5=w_6=w_7=w_8=w_9=w_10=w_11=w_12=w_13=w_14=None
-    w_15=w_15=w_16=w_17=w_18=w_19=w_res_20=w_21=None
-
-    goto = 1 # startblock
-    while True:
-
-        if goto == 1:
-            w_0 = space.getattr(w_self_1, gs_object)
-            _tup = space.newtuple([w_0])
-            w_2 = space.call(space.w_str, _tup)
-            w_3 = space.add(gs_object_, w_2)
-            w_4 = space.getattr(w_self_1, gs_end)
-            _tup = space.newtuple([w_4])
-            w_5 = space.call(space.w_str, _tup)
-            w_6 = space.add(gs_end_, w_5)
-            w_7 = space.getattr(w_self_1, gs_encoding)
-            _tup = space.newtuple([w_7])
-            w_8 = space.call(space.w_str, _tup)
-            w_9 = space.add(gs_encoding_, w_8)
-            w_10 = space.getattr(w_self_1, gs_args)
-            _tup = space.newtuple([w_10])
-            w_11 = space.call(space.w_str, _tup)
-            w_12 = space.add(gs_args_, w_11)
-            w_13 = space.getattr(w_self_1, gs_start)
-            _tup = space.newtuple([w_13])
-            w_14 = space.call(space.w_str, _tup)
-            w_15 = space.add(gs_start_, w_14)
-            w_16 = space.getattr(w_self_1, gs_reason)
-            _tup = space.newtuple([w_16])
-            w_17 = space.call(space.w_str, _tup)
-            w_18 = space.add(gs_reason_, w_17)
-            w_19 = space.newlist([w_3, w_6, w_9, w_12, w_15, w_18])
-            _tup = space.newtuple([w_19])
-            w_res_20 = space.call(gbltinmethod_join_3, _tup)
-            w_21 = w_res_20
-            goto = 2
-
-        if goto == 2:
-            return w_21
-fastf_UnicodeEncodeError___str__ = globals().pop("__str__")
-
-##SECTION##
-## filename    'geninterplevel.py'
+## filename    'D:\\pypy\\dist\\pypy\\translator\\geninterplevel.py'
 ## function    'test_exceptions'
-## firstlineno 1253
+## firstlineno 1246
 ##SECTION##
 # global declarations
 # global object gfunc_test_exceptions
 # global object gbltinmethod_keys
-# global object g46dict
+# global object g47dict
 # global object gs_keys
 
 def test_exceptions(space, *args_w):
@@ -943,7 +1021,7 @@
 def test_exceptions(space, ):
     """ enumerate all exceptions """
 
-    w_0=w_0=w_1=None
+    w_0=w_1=None
 
     goto = 1 # startblock
     while True:
@@ -964,7 +1042,7 @@
 # global object gcls_StandardError
 # global object gcls_Exception
 # global object gs___module__
-# global object gs_pypy_appspace__exceptions
+# global object gs_exceptions
 # global object gs___doc__
 # global object gs_Exception
 # global object gs_StandardError
@@ -982,10 +1060,14 @@
 # global object gcls_KeyError
 # global object gcls_LookupError
 # global object gs_LookupError
+# global object gs_TaskletExit
+# global object gcls_TaskletExit
+# global object gcls_SystemExit
+# global object gs_SystemExit
 # global object gs_StopIteration
 # global object gcls_StopIteration
-# global object gs_SyntaxWarning
-# global object gcls_SyntaxWarning
+# global object gs_PendingDeprecationWarning
+# global object gcls_PendingDeprecationWarning
 # global object gcls_Warning
 # global object gs_Warning
 # global object gs_EnvironmentError
@@ -998,8 +1080,12 @@
 # global object gcls_FloatingPointError
 # global object gcls_ArithmeticError
 # global object gs_ArithmeticError
-# global object gs_ReferenceError
-# global object gcls_ReferenceError
+# global object gs_AttributeError
+# global object gcls_AttributeError
+# global object gs_IndentationError
+# global object gcls_IndentationError
+# global object gcls_SyntaxError
+# global object gs_SyntaxError
 # global object gs_NameError
 # global object gcls_NameError
 # global object gs_OverflowWarning
@@ -1010,23 +1096,17 @@
 # global object gcls_FutureWarning
 # global object gs_ZeroDivisionError
 # global object gcls_ZeroDivisionError
-# global object gs_SystemExit
-# global object gcls_SystemExit
 # global object gs_EOFError
 # global object gcls_EOFError
-# global object gs___file__
-# global object gs__home_arigo_svn_pypy_dist_pypy_a
 # global object gs_TabError
 # global object gcls_TabError
-# global object gcls_IndentationError
-# global object gcls_SyntaxError
-# global object gs_SyntaxError
-# global object gs_IndentationError
 # global object gs_UnicodeEncodeError
 # global object gcls_UnicodeEncodeError
-# global object gs_SystemError
-# global object gcls_SystemError
+# global object gs_UnboundLocalError
+# global object gcls_UnboundLocalError
 # global object gs___name__
+# global object gs_ReferenceError
+# global object gcls_ReferenceError
 # global object gs_AssertionError
 # global object gcls_AssertionError
 # global object gs_UnicodeDecodeError
@@ -1041,16 +1121,16 @@
 # global object gcls_KeyboardInterrupt
 # global object gs_UserWarning
 # global object gcls_UserWarning
-# global object gs_PendingDeprecationWarning
-# global object gcls_PendingDeprecationWarning
-# global object gs_UnboundLocalError
-# global object gcls_UnboundLocalError
+# global object gs_SyntaxWarning
+# global object gcls_SyntaxWarning
 # global object gs_NotImplementedError
 # global object gcls_NotImplementedError
-# global object gs_AttributeError
-# global object gcls_AttributeError
+# global object gs_SystemError
+# global object gcls_SystemError
 # global object gs_OverflowError
 # global object gcls_OverflowError
+# global object gs_WindowsError
+# global object gcls_WindowsError
 # global object gs___init__
 # global object gfunc_UnicodeDecodeError___init__
 # global object gs___str__
@@ -1066,9 +1146,9 @@
 # global object gs_offset
 # global object gs_print_file_and_line
 # global object gs_text
-# global object gfunc_SystemExit___init__
 # global object gfunc_EnvironmentError___init__
 # global object gfunc_EnvironmentError___str__
+# global object gfunc_SystemExit___init__
 # global object gfunc_KeyError___str__
 # global object gfunc_UnicodeTranslateError___init__
 # global object gfunc_UnicodeTranslateError___str__
@@ -1087,9 +1167,10 @@
 
     from pypy.interpreter.gateway import interp2app
     m.gfunc_test_exceptions = space.wrap(interp2app(f_test_exceptions))
-    m.g46dict = space.newdict([])
+    m.__doc__ = space.wrap(m.__doc__)
+    m.g47dict = space.newdict([])
     m.gs_keys = space.wrap('keys')
-    m.gbltinmethod_keys = space.getattr(g46dict, gs_keys)
+    m.gbltinmethod_keys = space.getattr(g47dict, gs_keys)
     def PyArg_ParseMini(space, name, minargs, maxargs, args_w, defaults_w):
         err = None
         if len(args_w) < minargs:
@@ -1125,8 +1206,8 @@
     m.gs_MemoryError = space.wrap('MemoryError')
     _dic = space.newdict([])
     m.gs___module__ = space.wrap('__module__')
-    m.gs_pypy_appspace__exceptions = space.wrap('pypy.appspace._exceptions')
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    m.gs_exceptions = space.wrap('exceptions')
+    space.setitem(_dic, gs___module__, gs_exceptions)
     m.gs___doc__ = space.wrap('__doc__')
     _doc = space.wrap("""Common base class for all exceptions.""")
     space.setitem(_dic, gs___doc__, _doc)
@@ -1135,7 +1216,7 @@
     _args = space.newtuple([gs_Exception, _bases, _dic])
     m.gcls_Exception = space.call(space.w_type, _args)
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    space.setitem(_dic, gs___module__, gs_exceptions)
     _doc = space.wrap("""Base class for all standard Python exceptions.""")
     space.setitem(_dic, gs___doc__, _doc)
     m.gs_StandardError = space.wrap('StandardError')
@@ -1143,34 +1224,34 @@
     _args = space.newtuple([gs_StandardError, _bases, _dic])
     m.gcls_StandardError = space.call(space.w_type, _args)
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    space.setitem(_dic, gs___module__, gs_exceptions)
     _doc = space.wrap("""Out of memory.""")
     space.setitem(_dic, gs___doc__, _doc)
     _bases = space.newtuple([gcls_StandardError])
     _args = space.newtuple([gs_MemoryError, _bases, _dic])
     m.gcls_MemoryError = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_MemoryError, gcls_MemoryError)
+    space.setitem(g47dict, gs_MemoryError, gcls_MemoryError)
     m.gs_ImportError = space.wrap('ImportError')
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    space.setitem(_dic, gs___module__, gs_exceptions)
     _doc = space.wrap("""Import can't find module, or can't find name in module.""")
     space.setitem(_dic, gs___doc__, _doc)
     _bases = space.newtuple([gcls_StandardError])
     _args = space.newtuple([gs_ImportError, _bases, _dic])
     m.gcls_ImportError = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_ImportError, gcls_ImportError)
+    space.setitem(g47dict, gs_ImportError, gcls_ImportError)
     m.gs_RuntimeError = space.wrap('RuntimeError')
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    space.setitem(_dic, gs___module__, gs_exceptions)
     _doc = space.wrap("""Unspecified run-time error.""")
     space.setitem(_dic, gs___doc__, _doc)
     _bases = space.newtuple([gcls_StandardError])
     _args = space.newtuple([gs_RuntimeError, _bases, _dic])
     m.gcls_RuntimeError = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_RuntimeError, gcls_RuntimeError)
+    space.setitem(g47dict, gs_RuntimeError, gcls_RuntimeError)
     m.gs_UnicodeTranslateError = space.wrap('UnicodeTranslateError')
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    space.setitem(_dic, gs___module__, gs_exceptions)
     _doc = space.wrap("""Inappropriate argument value (of correct type).""")
     space.setitem(_dic, gs___doc__, _doc)
     m.gs_ValueError = space.wrap('ValueError')
@@ -1178,7 +1259,7 @@
     _args = space.newtuple([gs_ValueError, _bases, _dic])
     m.gcls_ValueError = space.call(space.w_type, _args)
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    space.setitem(_dic, gs___module__, gs_exceptions)
     _doc = space.wrap("""Unicode related error.""")
     space.setitem(_dic, gs___doc__, _doc)
     m.gs_UnicodeError = space.wrap('UnicodeError')
@@ -1186,16 +1267,16 @@
     _args = space.newtuple([gs_UnicodeError, _bases, _dic])
     m.gcls_UnicodeError = space.call(space.w_type, _args)
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    space.setitem(_dic, gs___module__, gs_exceptions)
     _doc = space.wrap("""Unicode translation error.""")
     space.setitem(_dic, gs___doc__, _doc)
     _bases = space.newtuple([gcls_UnicodeError])
     _args = space.newtuple([gs_UnicodeTranslateError, _bases, _dic])
     m.gcls_UnicodeTranslateError = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_UnicodeTranslateError, gcls_UnicodeTranslateError)
+    space.setitem(g47dict, gs_UnicodeTranslateError, gcls_UnicodeTranslateError)
     m.gs_KeyError = space.wrap('KeyError')
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    space.setitem(_dic, gs___module__, gs_exceptions)
     _doc = space.wrap("""Base class for lookup errors.""")
     space.setitem(_dic, gs___doc__, _doc)
     m.gs_LookupError = space.wrap('LookupError')
@@ -1203,25 +1284,42 @@
     _args = space.newtuple([gs_LookupError, _bases, _dic])
     m.gcls_LookupError = space.call(space.w_type, _args)
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    space.setitem(_dic, gs___module__, gs_exceptions)
     _doc = space.wrap("""Mapping key not found.""")
     space.setitem(_dic, gs___doc__, _doc)
     _bases = space.newtuple([gcls_LookupError])
     _args = space.newtuple([gs_KeyError, _bases, _dic])
     m.gcls_KeyError = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_KeyError, gcls_KeyError)
+    space.setitem(g47dict, gs_KeyError, gcls_KeyError)
+    m.gs_TaskletExit = space.wrap('TaskletExit')
+    _dic = space.newdict([])
+    space.setitem(_dic, gs___module__, gs_exceptions)
+    _doc = space.wrap("""Request to exit from the interpreter.""")
+    space.setitem(_dic, gs___doc__, _doc)
+    m.gs_SystemExit = space.wrap('SystemExit')
+    _bases = space.newtuple([gcls_Exception])
+    _args = space.newtuple([gs_SystemExit, _bases, _dic])
+    m.gcls_SystemExit = space.call(space.w_type, _args)
+    _dic = space.newdict([])
+    space.setitem(_dic, gs___module__, gs_exceptions)
+    _doc = space.wrap("""Request to exit from a tasklet.""")
+    space.setitem(_dic, gs___doc__, _doc)
+    _bases = space.newtuple([gcls_SystemExit])
+    _args = space.newtuple([gs_TaskletExit, _bases, _dic])
+    m.gcls_TaskletExit = space.call(space.w_type, _args)
+    space.setitem(g47dict, gs_TaskletExit, gcls_TaskletExit)
     m.gs_StopIteration = space.wrap('StopIteration')
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    space.setitem(_dic, gs___module__, gs_exceptions)
     _doc = space.wrap("""Signal the end from iterator.next().""")
     space.setitem(_dic, gs___doc__, _doc)
     _bases = space.newtuple([gcls_Exception])
     _args = space.newtuple([gs_StopIteration, _bases, _dic])
     m.gcls_StopIteration = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_StopIteration, gcls_StopIteration)
-    m.gs_SyntaxWarning = space.wrap('SyntaxWarning')
+    space.setitem(g47dict, gs_StopIteration, gcls_StopIteration)
+    m.gs_PendingDeprecationWarning = space.wrap('PendingDeprecationWarning')
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    space.setitem(_dic, gs___module__, gs_exceptions)
     _doc = space.wrap("""Base class for warning categories.""")
     space.setitem(_dic, gs___doc__, _doc)
     m.gs_Warning = space.wrap('Warning')
@@ -1229,45 +1327,45 @@
     _args = space.newtuple([gs_Warning, _bases, _dic])
     m.gcls_Warning = space.call(space.w_type, _args)
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
-    _doc = space.wrap("""Base class for warnings about dubious syntax.""")
+    space.setitem(_dic, gs___module__, gs_exceptions)
+    _doc = space.wrap("""Base class for warnings about features which will be deprecated in the future.""")
     space.setitem(_dic, gs___doc__, _doc)
     _bases = space.newtuple([gcls_Warning])
-    _args = space.newtuple([gs_SyntaxWarning, _bases, _dic])
-    m.gcls_SyntaxWarning = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_SyntaxWarning, gcls_SyntaxWarning)
+    _args = space.newtuple([gs_PendingDeprecationWarning, _bases, _dic])
+    m.gcls_PendingDeprecationWarning = space.call(space.w_type, _args)
+    space.setitem(g47dict, gs_PendingDeprecationWarning, gcls_PendingDeprecationWarning)
     m.gs_EnvironmentError = space.wrap('EnvironmentError')
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    space.setitem(_dic, gs___module__, gs_exceptions)
     _doc = space.wrap("""Base class for I/O related errors.""")
     space.setitem(_dic, gs___doc__, _doc)
     _bases = space.newtuple([gcls_StandardError])
     _args = space.newtuple([gs_EnvironmentError, _bases, _dic])
     m.gcls_EnvironmentError = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_EnvironmentError, gcls_EnvironmentError)
-    space.setitem(g46dict, gs_LookupError, gcls_LookupError)
+    space.setitem(g47dict, gs_EnvironmentError, gcls_EnvironmentError)
+    space.setitem(g47dict, gs_LookupError, gcls_LookupError)
     m.gs_OSError = space.wrap('OSError')
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    space.setitem(_dic, gs___module__, gs_exceptions)
     _doc = space.wrap("""OS system call failed.""")
     space.setitem(_dic, gs___doc__, _doc)
     _bases = space.newtuple([gcls_EnvironmentError])
     _args = space.newtuple([gs_OSError, _bases, _dic])
     m.gcls_OSError = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_OSError, gcls_OSError)
+    space.setitem(g47dict, gs_OSError, gcls_OSError)
     m.gs_DeprecationWarning = space.wrap('DeprecationWarning')
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    space.setitem(_dic, gs___module__, gs_exceptions)
     _doc = space.wrap("""Base class for warnings about deprecated features.""")
     space.setitem(_dic, gs___doc__, _doc)
     _bases = space.newtuple([gcls_Warning])
     _args = space.newtuple([gs_DeprecationWarning, _bases, _dic])
     m.gcls_DeprecationWarning = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_DeprecationWarning, gcls_DeprecationWarning)
-    space.setitem(g46dict, gs_UnicodeError, gcls_UnicodeError)
+    space.setitem(g47dict, gs_DeprecationWarning, gcls_DeprecationWarning)
+    space.setitem(g47dict, gs_UnicodeError, gcls_UnicodeError)
     m.gs_FloatingPointError = space.wrap('FloatingPointError')
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    space.setitem(_dic, gs___module__, gs_exceptions)
     _doc = space.wrap("""Base class for arithmetic errors.""")
     space.setitem(_dic, gs___doc__, _doc)
     m.gs_ArithmeticError = space.wrap('ArithmeticError')
@@ -1275,252 +1373,250 @@
     _args = space.newtuple([gs_ArithmeticError, _bases, _dic])
     m.gcls_ArithmeticError = space.call(space.w_type, _args)
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    space.setitem(_dic, gs___module__, gs_exceptions)
     _doc = space.wrap("""Floating point operation failed.""")
     space.setitem(_dic, gs___doc__, _doc)
     _bases = space.newtuple([gcls_ArithmeticError])
     _args = space.newtuple([gs_FloatingPointError, _bases, _dic])
     m.gcls_FloatingPointError = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_FloatingPointError, gcls_FloatingPointError)
-    m.gs_ReferenceError = space.wrap('ReferenceError')
+    space.setitem(g47dict, gs_FloatingPointError, gcls_FloatingPointError)
+    m.gs_AttributeError = space.wrap('AttributeError')
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
-    _doc = space.wrap("""Weak ref proxy used after referent went away.""")
+    space.setitem(_dic, gs___module__, gs_exceptions)
+    _doc = space.wrap("""Attribute not found.""")
     space.setitem(_dic, gs___doc__, _doc)
     _bases = space.newtuple([gcls_StandardError])
-    _args = space.newtuple([gs_ReferenceError, _bases, _dic])
-    m.gcls_ReferenceError = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_ReferenceError, gcls_ReferenceError)
+    _args = space.newtuple([gs_AttributeError, _bases, _dic])
+    m.gcls_AttributeError = space.call(space.w_type, _args)
+    space.setitem(g47dict, gs_AttributeError, gcls_AttributeError)
+    m.gs_IndentationError = space.wrap('IndentationError')
+    _dic = space.newdict([])
+    space.setitem(_dic, gs___module__, gs_exceptions)
+    _doc = space.wrap("""Invalid syntax.""")
+    space.setitem(_dic, gs___doc__, _doc)
+    m.gs_SyntaxError = space.wrap('SyntaxError')
+    _bases = space.newtuple([gcls_StandardError])
+    _args = space.newtuple([gs_SyntaxError, _bases, _dic])
+    m.gcls_SyntaxError = space.call(space.w_type, _args)
+    _dic = space.newdict([])
+    space.setitem(_dic, gs___module__, gs_exceptions)
+    _doc = space.wrap("""Improper indentation.""")
+    space.setitem(_dic, gs___doc__, _doc)
+    _bases = space.newtuple([gcls_SyntaxError])
+    _args = space.newtuple([gs_IndentationError, _bases, _dic])
+    m.gcls_IndentationError = space.call(space.w_type, _args)
+    space.setitem(g47dict, gs_IndentationError, gcls_IndentationError)
     m.gs_NameError = space.wrap('NameError')
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    space.setitem(_dic, gs___module__, gs_exceptions)
     _doc = space.wrap("""Name not found globally.""")
     space.setitem(_dic, gs___doc__, _doc)
     _bases = space.newtuple([gcls_StandardError])
     _args = space.newtuple([gs_NameError, _bases, _dic])
     m.gcls_NameError = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_NameError, gcls_NameError)
+    space.setitem(g47dict, gs_NameError, gcls_NameError)
     m.gs_OverflowWarning = space.wrap('OverflowWarning')
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    space.setitem(_dic, gs___module__, gs_exceptions)
     _doc = space.wrap("""Base class for warnings about numeric overflow.""")
     space.setitem(_dic, gs___doc__, _doc)
     _bases = space.newtuple([gcls_Warning])
     _args = space.newtuple([gs_OverflowWarning, _bases, _dic])
     m.gcls_OverflowWarning = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_OverflowWarning, gcls_OverflowWarning)
+    space.setitem(g47dict, gs_OverflowWarning, gcls_OverflowWarning)
     m.gs_IOError = space.wrap('IOError')
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    space.setitem(_dic, gs___module__, gs_exceptions)
     _doc = space.wrap("""I/O operation failed.""")
     space.setitem(_dic, gs___doc__, _doc)
     _bases = space.newtuple([gcls_EnvironmentError])
     _args = space.newtuple([gs_IOError, _bases, _dic])
     m.gcls_IOError = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_IOError, gcls_IOError)
-    space.setitem(g46dict, gs_ValueError, gcls_ValueError)
+    space.setitem(g47dict, gs_IOError, gcls_IOError)
+    space.setitem(g47dict, gs_ValueError, gcls_ValueError)
     m.gs_FutureWarning = space.wrap('FutureWarning')
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    space.setitem(_dic, gs___module__, gs_exceptions)
     _doc = space.wrap("""Base class for warnings about constructs that will change semantically in the future.""")
     space.setitem(_dic, gs___doc__, _doc)
     _bases = space.newtuple([gcls_Warning])
     _args = space.newtuple([gs_FutureWarning, _bases, _dic])
     m.gcls_FutureWarning = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_FutureWarning, gcls_FutureWarning)
+    space.setitem(g47dict, gs_FutureWarning, gcls_FutureWarning)
     m.gs_ZeroDivisionError = space.wrap('ZeroDivisionError')
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    space.setitem(_dic, gs___module__, gs_exceptions)
     _doc = space.wrap("""Second argument to a division or modulo operation was zero.""")
     space.setitem(_dic, gs___doc__, _doc)
     _bases = space.newtuple([gcls_ArithmeticError])
     _args = space.newtuple([gs_ZeroDivisionError, _bases, _dic])
     m.gcls_ZeroDivisionError = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_ZeroDivisionError, gcls_ZeroDivisionError)
-    m.gs_SystemExit = space.wrap('SystemExit')
-    _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
-    _doc = space.wrap("""Request to exit from the interpreter.""")
-    space.setitem(_dic, gs___doc__, _doc)
-    _bases = space.newtuple([gcls_Exception])
-    _args = space.newtuple([gs_SystemExit, _bases, _dic])
-    m.gcls_SystemExit = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_SystemExit, gcls_SystemExit)
-    space.setitem(g46dict, gs_Exception, gcls_Exception)
+    space.setitem(g47dict, gs_ZeroDivisionError, gcls_ZeroDivisionError)
+    space.setitem(g47dict, gs_SystemExit, gcls_SystemExit)
+    space.setitem(g47dict, gs_Exception, gcls_Exception)
     m.gs_EOFError = space.wrap('EOFError')
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    space.setitem(_dic, gs___module__, gs_exceptions)
     _doc = space.wrap("""Read beyond end of file.""")
     space.setitem(_dic, gs___doc__, _doc)
     _bases = space.newtuple([gcls_StandardError])
     _args = space.newtuple([gs_EOFError, _bases, _dic])
     m.gcls_EOFError = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_EOFError, gcls_EOFError)
-    space.setitem(g46dict, gs_StandardError, gcls_StandardError)
-    m.gs___file__ = space.wrap('__file__')
-    m.gs__home_arigo_svn_pypy_dist_pypy_a = space.wrap('/home/arigo/svn/pypy/dist/pypy/appspace/_exceptions.pyc')
-    space.setitem(g46dict, gs___file__, gs__home_arigo_svn_pypy_dist_pypy_a)
+    space.setitem(g47dict, gs_EOFError, gcls_EOFError)
+    space.setitem(g47dict, gs_StandardError, gcls_StandardError)
     m.gs_TabError = space.wrap('TabError')
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
-    _doc = space.wrap("""Invalid syntax.""")
-    space.setitem(_dic, gs___doc__, _doc)
-    m.gs_SyntaxError = space.wrap('SyntaxError')
-    _bases = space.newtuple([gcls_StandardError])
-    _args = space.newtuple([gs_SyntaxError, _bases, _dic])
-    m.gcls_SyntaxError = space.call(space.w_type, _args)
-    _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
-    _doc = space.wrap("""Improper indentation.""")
-    space.setitem(_dic, gs___doc__, _doc)
-    m.gs_IndentationError = space.wrap('IndentationError')
-    _bases = space.newtuple([gcls_SyntaxError])
-    _args = space.newtuple([gs_IndentationError, _bases, _dic])
-    m.gcls_IndentationError = space.call(space.w_type, _args)
-    _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    space.setitem(_dic, gs___module__, gs_exceptions)
     _doc = space.wrap("""Improper mixture of spaces and tabs.""")
     space.setitem(_dic, gs___doc__, _doc)
     _bases = space.newtuple([gcls_IndentationError])
     _args = space.newtuple([gs_TabError, _bases, _dic])
     m.gcls_TabError = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_TabError, gcls_TabError)
-    space.setitem(g46dict, gs_SyntaxError, gcls_SyntaxError)
+    space.setitem(g47dict, gs_TabError, gcls_TabError)
+    space.setitem(g47dict, gs_SyntaxError, gcls_SyntaxError)
     m.gs_UnicodeEncodeError = space.wrap('UnicodeEncodeError')
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    space.setitem(_dic, gs___module__, gs_exceptions)
     _doc = space.wrap("""Unicode encoding error.""")
     space.setitem(_dic, gs___doc__, _doc)
     _bases = space.newtuple([gcls_UnicodeError])
     _args = space.newtuple([gs_UnicodeEncodeError, _bases, _dic])
     m.gcls_UnicodeEncodeError = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_UnicodeEncodeError, gcls_UnicodeEncodeError)
-    m.gs_SystemError = space.wrap('SystemError')
+    space.setitem(g47dict, gs_UnicodeEncodeError, gcls_UnicodeEncodeError)
+    m.gs_UnboundLocalError = space.wrap('UnboundLocalError')
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
-    _doc = space.wrap("""Internal error in the Python interpreter.
-    
-    Please report this to the Python maintainer, along with the traceback,
-    the Python version, and the hardware/OS platform and version.""")
+    space.setitem(_dic, gs___module__, gs_exceptions)
+    _doc = space.wrap("""Local name referenced but not bound to a value.""")
     space.setitem(_dic, gs___doc__, _doc)
-    _bases = space.newtuple([gcls_StandardError])
-    _args = space.newtuple([gs_SystemError, _bases, _dic])
-    m.gcls_SystemError = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_SystemError, gcls_SystemError)
+    _bases = space.newtuple([gcls_NameError])
+    _args = space.newtuple([gs_UnboundLocalError, _bases, _dic])
+    m.gcls_UnboundLocalError = space.call(space.w_type, _args)
+    space.setitem(g47dict, gs_UnboundLocalError, gcls_UnboundLocalError)
     m.gs___name__ = space.wrap('__name__')
-    space.setitem(g46dict, gs___name__, gs_pypy_appspace__exceptions)
-    space.setitem(g46dict, gs_IndentationError, gcls_IndentationError)
+    space.setitem(g47dict, gs___name__, gs_exceptions)
+    m.gs_ReferenceError = space.wrap('ReferenceError')
+    _dic = space.newdict([])
+    space.setitem(_dic, gs___module__, gs_exceptions)
+    _doc = space.wrap("""Weak ref proxy used after referent went away.""")
+    space.setitem(_dic, gs___doc__, _doc)
+    _bases = space.newtuple([gcls_StandardError])
+    _args = space.newtuple([gs_ReferenceError, _bases, _dic])
+    m.gcls_ReferenceError = space.call(space.w_type, _args)
+    space.setitem(g47dict, gs_ReferenceError, gcls_ReferenceError)
     m.gs_AssertionError = space.wrap('AssertionError')
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    space.setitem(_dic, gs___module__, gs_exceptions)
     _doc = space.wrap("""Assertion failed.""")
     space.setitem(_dic, gs___doc__, _doc)
     _bases = space.newtuple([gcls_StandardError])
     _args = space.newtuple([gs_AssertionError, _bases, _dic])
     m.gcls_AssertionError = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_AssertionError, gcls_AssertionError)
+    space.setitem(g47dict, gs_AssertionError, gcls_AssertionError)
     m.gs_UnicodeDecodeError = space.wrap('UnicodeDecodeError')
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    space.setitem(_dic, gs___module__, gs_exceptions)
     _doc = space.wrap("""Unicode decoding error.""")
     space.setitem(_dic, gs___doc__, _doc)
     _bases = space.newtuple([gcls_UnicodeError])
     _args = space.newtuple([gs_UnicodeDecodeError, _bases, _dic])
     m.gcls_UnicodeDecodeError = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_UnicodeDecodeError, gcls_UnicodeDecodeError)
+    space.setitem(g47dict, gs_UnicodeDecodeError, gcls_UnicodeDecodeError)
     m.gs_TypeError = space.wrap('TypeError')
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    space.setitem(_dic, gs___module__, gs_exceptions)
     _doc = space.wrap("""Inappropriate argument type.""")
     space.setitem(_dic, gs___doc__, _doc)
     _bases = space.newtuple([gcls_StandardError])
     _args = space.newtuple([gs_TypeError, _bases, _dic])
     m.gcls_TypeError = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_TypeError, gcls_TypeError)
+    space.setitem(g47dict, gs_TypeError, gcls_TypeError)
     m.gs_IndexError = space.wrap('IndexError')
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    space.setitem(_dic, gs___module__, gs_exceptions)
     _doc = space.wrap("""Sequence index out of range.""")
     space.setitem(_dic, gs___doc__, _doc)
     _bases = space.newtuple([gcls_LookupError])
     _args = space.newtuple([gs_IndexError, _bases, _dic])
     m.gcls_IndexError = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_IndexError, gcls_IndexError)
+    space.setitem(g47dict, gs_IndexError, gcls_IndexError)
     m.gs_RuntimeWarning = space.wrap('RuntimeWarning')
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    space.setitem(_dic, gs___module__, gs_exceptions)
     _doc = space.wrap("""Base class for warnings about dubious runtime behavior.""")
     space.setitem(_dic, gs___doc__, _doc)
     _bases = space.newtuple([gcls_Warning])
     _args = space.newtuple([gs_RuntimeWarning, _bases, _dic])
     m.gcls_RuntimeWarning = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_RuntimeWarning, gcls_RuntimeWarning)
+    space.setitem(g47dict, gs_RuntimeWarning, gcls_RuntimeWarning)
     m.gs_KeyboardInterrupt = space.wrap('KeyboardInterrupt')
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    space.setitem(_dic, gs___module__, gs_exceptions)
     _doc = space.wrap("""Program interrupted by user.""")
     space.setitem(_dic, gs___doc__, _doc)
     _bases = space.newtuple([gcls_StandardError])
     _args = space.newtuple([gs_KeyboardInterrupt, _bases, _dic])
     m.gcls_KeyboardInterrupt = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_KeyboardInterrupt, gcls_KeyboardInterrupt)
-    space.setitem(g46dict, gs___doc__, space.w_None)
+    space.setitem(g47dict, gs_KeyboardInterrupt, gcls_KeyboardInterrupt)
     m.gs_UserWarning = space.wrap('UserWarning')
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    space.setitem(_dic, gs___module__, gs_exceptions)
     _doc = space.wrap("""Base class for warnings generated by user code.""")
     space.setitem(_dic, gs___doc__, _doc)
     _bases = space.newtuple([gcls_Warning])
     _args = space.newtuple([gs_UserWarning, _bases, _dic])
     m.gcls_UserWarning = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_UserWarning, gcls_UserWarning)
-    m.gs_PendingDeprecationWarning = space.wrap('PendingDeprecationWarning')
+    space.setitem(g47dict, gs_UserWarning, gcls_UserWarning)
+    m.gs_SyntaxWarning = space.wrap('SyntaxWarning')
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
-    _doc = space.wrap("""Base class for warnings about features which will be deprecated in the future.""")
+    space.setitem(_dic, gs___module__, gs_exceptions)
+    _doc = space.wrap("""Base class for warnings about dubious syntax.""")
     space.setitem(_dic, gs___doc__, _doc)
     _bases = space.newtuple([gcls_Warning])
-    _args = space.newtuple([gs_PendingDeprecationWarning, _bases, _dic])
-    m.gcls_PendingDeprecationWarning = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_PendingDeprecationWarning, gcls_PendingDeprecationWarning)
-    m.gs_UnboundLocalError = space.wrap('UnboundLocalError')
-    _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
-    _doc = space.wrap("""Local name referenced but not bound to a value.""")
-    space.setitem(_dic, gs___doc__, _doc)
-    _bases = space.newtuple([gcls_NameError])
-    _args = space.newtuple([gs_UnboundLocalError, _bases, _dic])
-    m.gcls_UnboundLocalError = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_UnboundLocalError, gcls_UnboundLocalError)
-    space.setitem(g46dict, gs_ArithmeticError, gcls_ArithmeticError)
-    space.setitem(g46dict, gs_Warning, gcls_Warning)
+    _args = space.newtuple([gs_SyntaxWarning, _bases, _dic])
+    m.gcls_SyntaxWarning = space.call(space.w_type, _args)
+    space.setitem(g47dict, gs_SyntaxWarning, gcls_SyntaxWarning)
+    space.setitem(g47dict, gs___doc__, __doc__)
+    space.setitem(g47dict, gs_ArithmeticError, gcls_ArithmeticError)
+    space.setitem(g47dict, gs_Warning, gcls_Warning)
     m.gs_NotImplementedError = space.wrap('NotImplementedError')
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    space.setitem(_dic, gs___module__, gs_exceptions)
     _doc = space.wrap("""Method or function hasn't been implemented yet.""")
     space.setitem(_dic, gs___doc__, _doc)
     _bases = space.newtuple([gcls_RuntimeError])
     _args = space.newtuple([gs_NotImplementedError, _bases, _dic])
     m.gcls_NotImplementedError = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_NotImplementedError, gcls_NotImplementedError)
-    m.gs_AttributeError = space.wrap('AttributeError')
+    space.setitem(g47dict, gs_NotImplementedError, gcls_NotImplementedError)
+    m.gs_SystemError = space.wrap('SystemError')
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
-    _doc = space.wrap("""Attribute not found.""")
+    space.setitem(_dic, gs___module__, gs_exceptions)
+    _doc = space.wrap("""Internal error in the Python interpreter.
+    
+    Please report this to the Python maintainer, along with the traceback,
+    the Python version, and the hardware/OS platform and version.""")
     space.setitem(_dic, gs___doc__, _doc)
     _bases = space.newtuple([gcls_StandardError])
-    _args = space.newtuple([gs_AttributeError, _bases, _dic])
-    m.gcls_AttributeError = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_AttributeError, gcls_AttributeError)
+    _args = space.newtuple([gs_SystemError, _bases, _dic])
+    m.gcls_SystemError = space.call(space.w_type, _args)
+    space.setitem(g47dict, gs_SystemError, gcls_SystemError)
     m.gs_OverflowError = space.wrap('OverflowError')
     _dic = space.newdict([])
-    space.setitem(_dic, gs___module__, gs_pypy_appspace__exceptions)
+    space.setitem(_dic, gs___module__, gs_exceptions)
     _doc = space.wrap("""Result too large to be represented.""")
     space.setitem(_dic, gs___doc__, _doc)
     _bases = space.newtuple([gcls_ArithmeticError])
     _args = space.newtuple([gs_OverflowError, _bases, _dic])
     m.gcls_OverflowError = space.call(space.w_type, _args)
-    space.setitem(g46dict, gs_OverflowError, gcls_OverflowError)
+    space.setitem(g47dict, gs_OverflowError, gcls_OverflowError)
+    m.gs_WindowsError = space.wrap('WindowsError')
+    _dic = space.newdict([])
+    space.setitem(_dic, gs___module__, gs_exceptions)
+    _doc = space.wrap("""MS-Windows OS system call failed.""")
+    space.setitem(_dic, gs___doc__, _doc)
+    _bases = space.newtuple([gcls_OSError])
+    _args = space.newtuple([gs_WindowsError, _bases, _dic])
+    m.gcls_WindowsError = space.call(space.w_type, _args)
+    space.setitem(g47dict, gs_WindowsError, gcls_WindowsError)
     m.gs___init__ = space.wrap('__init__')
     m.gfunc_UnicodeDecodeError___init__ = space.wrap(interp2app(f_UnicodeDecodeError___init__))
     space.setattr(gcls_UnicodeDecodeError, gs___init__, gfunc_UnicodeDecodeError___init__)
@@ -1548,12 +1644,12 @@
     space.setattr(gcls_SyntaxError, gs_print_file_and_line, space.w_None)
     m.gs_text = space.wrap('text')
     space.setattr(gcls_SyntaxError, gs_text, space.w_None)
-    m.gfunc_SystemExit___init__ = space.wrap(interp2app(f_SystemExit___init__))
-    space.setattr(gcls_SystemExit, gs___init__, gfunc_SystemExit___init__)
     m.gfunc_EnvironmentError___init__ = space.wrap(interp2app(f_EnvironmentError___init__))
     space.setattr(gcls_EnvironmentError, gs___init__, gfunc_EnvironmentError___init__)
     m.gfunc_EnvironmentError___str__ = space.wrap(interp2app(f_EnvironmentError___str__))
     space.setattr(gcls_EnvironmentError, gs___str__, gfunc_EnvironmentError___str__)
+    m.gfunc_SystemExit___init__ = space.wrap(interp2app(f_SystemExit___init__))
+    space.setattr(gcls_SystemExit, gs___init__, gfunc_SystemExit___init__)
     m.gfunc_KeyError___str__ = space.wrap(interp2app(f_KeyError___str__))
     space.setattr(gcls_KeyError, gs___str__, gfunc_KeyError___str__)
     m.gfunc_UnicodeTranslateError___init__ = space.wrap(interp2app(f_UnicodeTranslateError___init__))
@@ -1585,19 +1681,15 @@
     m.gi_4 = space.newint(4)
     m.gi_2 = space.newint(2)
     m.gi_3 = space.newint(3)
+    m.gs_code = space.wrap('code')
     m.gs_errno = space.wrap('errno')
     m.gs_errno_ = space.wrap('errno=')
     m.gs_strerror = space.wrap('strerror')
     m.gs_strerror_ = space.wrap('strerror=')
     m.gs_filename_ = space.wrap('filename=')
-    m.gbltinmethod_join_1 = space.getattr(gs__, gs_join)
-    m.gs_code = space.wrap('code')
-    m.gbltinmethod_join_2 = space.getattr(gs__, gs_join)
     m.gs_encoding = space.wrap('encoding')
     m.gs_encoding_ = space.wrap('encoding=')
-    m.gbltinmethod_join_3 = space.getattr(gs__, gs_join)
     m.gi_5 = space.newint(5)
-    m.gbltinmethod_join_4 = space.getattr(gs__, gs_join)
 
 # entry point: test_exceptions, gfunc_test_exceptions)
 if __name__ == "__main__":

Modified: pypy/dist/pypy/objspace/std/objspace.py
==============================================================================
--- pypy/dist/pypy/objspace/std/objspace.py	(original)
+++ pypy/dist/pypy/objspace/std/objspace.py	Sat Jan 29 01:44:32 2005
@@ -230,6 +230,7 @@
                     setattr(self, "w_"+excname, w_obj) # into space
                     for_builtins[excname] = w_obj # into builtins
                     self.setitem(w_dic, self.wrap(excname), w_obj) # into exc
+            self.setitem(w_dic, self.wrap("__doc__"), ex.__doc__)
         finally:
             del self.call # revert to the class' method
         
@@ -237,6 +238,7 @@
         # XXX refine things, clean up, create a builtin module...
         # but for now, we do a regular one.
         from pypy.interpreter.module import Module
+        
         m = Module(self, self.wrap("exceptions"), w_dic)
         w_exceptions = self.wrap(m)
         self.sys.setbuiltinmodule(w_exceptions, 'exceptions')

Modified: pypy/dist/pypy/tool/_enum_exceptions.py
==============================================================================
--- pypy/dist/pypy/tool/_enum_exceptions.py	(original)
+++ pypy/dist/pypy/tool/_enum_exceptions.py	Sat Jan 29 01:44:32 2005
@@ -6,6 +6,8 @@
 
 import types
 
+from pypy.tool.sourcetools import render_docstr
+
 def classOfAttribute(klass, attname):
     if attname in klass.__dict__:
         return klass
@@ -19,8 +21,7 @@
 
 def makeExceptionsTemplate(f=None):
     
-    def enumExceptionsInOrder():
-        import exceptions
+    def enumClassesInOrder(module):
         seen = {}
         ordered = []
         
@@ -31,7 +32,7 @@
                     enumerateOne(each)
             ordered.append(exc)
             
-        for each in exceptions.__dict__.values():
+        for each in module.__dict__.values():
             if isinstance(each, (types.ClassType, type)) and \
                each not in seen:
                 enumerateOne(each)
@@ -41,7 +42,11 @@
     if not f:
         f = sys.stdout
 
-    for exc in enumExceptionsInOrder():
+    import exceptions
+    for line in render_docstr(exceptions, ""):
+        print >> f, line
+        
+    for exc in enumClassesInOrder(exceptions):
         name = exc.__name__
         bases = exc.__bases__
         doc = exc.__doc__
@@ -57,6 +62,7 @@
             if classOfAttribute(exc, attname) is exc:
                 obj = getattr(exc, attname)
                 (simple, difficult)[callable(obj)].append( (attname, obj) )
+        print >> f
         print >> f, "class %s%s:" % (name, bases)
         if doc:
             print >> f, '    """%s"""' % doc
@@ -78,7 +84,6 @@
                 except ValueError, e:
                     print >> f, "    # %s" % e
                     print >> f, "    # please implement %s.%s (%r)" % (name, attname, meth)
-        print >> f
 
 def tryGenerate__getitem__(exc):
     for args in (), (1, 2, 3):
@@ -325,7 +330,9 @@
     yield "    return res"
 
 if __name__ == "__main__":
-    import pypy.appspace, os
-    targetdir = os.path.dirname(pypy.appspace.__file__)
-    fname = os.path.join(targetdir, "_exceptions.py")
-    makeExceptionsTemplate(file(fname, "w"))
+    import pypy, os
+    prefix = os.path.dirname(pypy.__file__)
+    libdir = os.path.join(prefix, "lib")
+    fname = "_exceptions.pre.py"
+    fpath = os.path.join(libdir, fname)
+    makeExceptionsTemplate(file(fpath, "w"))

Modified: pypy/dist/pypy/tool/sourcetools.py
==============================================================================
--- pypy/dist/pypy/tool/sourcetools.py	(original)
+++ pypy/dist/pypy/tool/sourcetools.py	Sat Jan 29 01:44:32 2005
@@ -1,21 +1,19 @@
 # a couple of support functions which
 # help with generating Python source.
 
-# this script is used for extracting
-# the information available for exceptions
-# via introspection.
-# The idea is to use it once to create
-# a template for a re-birth of exceptions.py
-
-def render_docstr(func, indent_str, q='"""', redo=True):
-    """render a docstring as a sequenceof lines """
-    doc = func.__doc__
+def render_docstr(func, indent_str='', closing_str='', q='"""', redo=True):
+    """ Render a docstring as a sequence of lines.
+        The argument is either a docstring or an object"""
+    if type(func) is not str:
+        doc = func.__doc__
+    else:
+        doc = func
     if doc is None:
         return []
-    doc = indent_str + q + doc.replace(q, "\\"+q) + q
+    doc = indent_str + q + doc.replace(q, "\\"+q) + q + closing_str
     doc2 = doc
     if q in doc and redo:
-        doc2 = render_docstr(func, indent_str, "'''", False)
+        doc2 = render_docstr(func, indent_str, closing_str, "'''", False)
     if not redo:
         return doc # recursion case
     doc = (doc, doc2)[len(doc2) < len(doc)]

Modified: pypy/dist/pypy/translator/geninterplevel.py
==============================================================================
--- pypy/dist/pypy/translator/geninterplevel.py	(original)
+++ pypy/dist/pypy/translator/geninterplevel.py	Sat Jan 29 01:44:32 2005
@@ -42,6 +42,7 @@
 
 from pypy.interpreter.gateway import app2interp, interp2app
 
+from pypy.tool.sourcetools import render_docstr
 
 # ____________________________________________________________
 
@@ -103,6 +104,7 @@
         self.translator = translator
         self.modname = self.trans_funcname(modname or
                         uniquemodulename(translator.functions[0].__name__))
+        self.moddict = None # the dict if we translate a module
         self.rpynames = {Constant(None).key:  'space.w_None',
                          Constant(False).key: 'space.w_False',
                          Constant(True).key:  'space.w_True',
@@ -125,11 +127,6 @@
         for name in "newtuple newlist newdict newstring".split():
             self.has_listarg[name] = name
 
-        # XXX I guess it is cleaner to use the flow space?
-        # we just want to look into the operations,
-        # but we don't break into the implementation.
-        # Or should it be the base space, ARMIN?
-        #self.space = StdObjSpace() # for introspection
         self.space = FlowObjSpace() # for introspection
         
         self.use_fast_call = False        
@@ -219,7 +216,8 @@
             ass = var+"="
             if not res or len(res[-1]) >= margin:
                 res.append(ass)
-            res[-1] += ass
+            else:
+                res[-1] += ass
         res = [line + nonestr for line in res]
         return res
 
@@ -570,8 +568,7 @@
 
         if cls.__doc__ is not None:
             sdoc = self.nameof("__doc__")
-            lines = list(self.render_docstr(cls, "_doc = space.wrap("))
-            lines[-1] +=")"
+            lines = list(render_docstr(cls, "_doc = space.wrap(", ")"))
             self.initcode.extend(lines)
             self.initcode.appendnew("space.setitem(_dic, %s, _doc)" % (
                 self.nameof("__doc__"),))
@@ -754,7 +751,19 @@
             }
         # header
         print >> f, self.RPY_HEADER
+        print >> f
 
+        # doc
+        if self.moddict and self.moddict.get("__doc__"):
+            doc = self.moddict["__doc__"]
+            for line in render_docstr(doc):
+                print >> f, line
+            print >> f
+            # make sure it is not rendered again
+            key = Constant(doc).key
+            self.rpynames[key] = "__doc__"
+            self.seennames["__doc__"] = 1
+            self.initcode.append("m.__doc__ = space.wrap(m.__doc__)")
         # function implementations
         while self.pendingfunctions:
             func = self.pendingfunctions.pop()
@@ -792,20 +801,6 @@
         for name in g:
             pass # self.initcode.append('# REGISTER_GLOBAL(%s)' % (name,))
         del g[:]
-
-
-    def render_docstr(self, func, indent_str, q='"""', redo=True):
-        doc = func.__doc__
-        if doc is None:
-            return []
-        doc = indent_str + q + doc.replace(q, "\\"+q) + q
-        doc2 = doc
-        if q in doc and redo:
-            doc2 = self.render_docstr(func, indent_str, "'''", False)
-        if not redo:
-            return doc # recursion case
-        doc = (doc, doc2)[len(doc2) < len(doc)]
-        return [line for line in doc.split('\n')]
     
     def gen_rpyfunction(self, func):
 
@@ -825,7 +820,7 @@
         self.gen_global_declarations()
 
         # print header
-        doc_lines = self.render_docstr(func, "    ")
+        doc_lines = render_docstr(func, "    ")
         cname = self.nameof(func)
         assert cname.startswith('gfunc_')
         f_name = 'f_' + cname[6:]
@@ -1240,21 +1235,19 @@
     return res1, res2
 
 def test_exceptions_helper():
-    def demoduliseDict(mod):
-        # get the raw dict without module stuff like __builtins__
-        dic = mod.__dict__.copy()
-        bad = ("__builtins__", )  # anything else?
-        for name in bad:
-            if name in dic:
-                del dic[name]
-        return dic
-    from pypy.appspace import _exceptions
-    a = demoduliseDict(_exceptions)
+    import pypy
+    prefix = os.path.dirname(pypy.__file__)
+    libdir = os.path.join(prefix, "lib")
+    fname = "_exceptions.py"
+    fpath = os.path.join(libdir, fname)
+    dic = {"__name__": "exceptions"}
+    execfile(fpath, dic)
+    del dic["__builtins__"]
     def test_exceptions():
         """ enumerate all exceptions """
-        return a.keys()
+        return dic.keys()
         #return [thing for thing in _exceptions.__dict__.values()]
-    return test_exceptions
+    return dic, test_exceptions
 
 def all_entries():
     res = [func() for func in entrypoints[:-1]]
@@ -1284,11 +1277,13 @@
     if appdir not in sys.path:
         sys.path.insert(0, appdir)
 
+    dic = None
     if entrypoint.__name__.endswith("_helper"):
-        entrypoint = entrypoint()
+        dic, entrypoint = entrypoint()
     t = Translator(entrypoint, verbose=False, simplifying=True)
     gen = GenRpy(t)
     gen.use_fast_call = True
+    if dic: gen.moddict = dic
     import pypy.appspace.generated as tmp
     pth = os.path.dirname(tmp.__file__)
     ftmpname = "/tmp/look.py"
@@ -1305,7 +1300,7 @@
     """ this thingy is generating the whole interpreter in itself"""
     # but doesn't work, my goto's give a problem for flow space
     dic = {"__builtins__": __builtins__, "__name__": "__main__"}
-    execfile("d:/tmp/look.py", dic)
+    execfile("/tmp/look.py", dic)
     
     def test():
         f_ff(space, 2, 3)
@@ -1313,4 +1308,4 @@
         
     t = Translator(test, verbose=False, simplifying=True)
     gen = GenRpy(t)
-    gen.gen_source("d:/tmp/look2.py")
+    gen.gen_source("/tmp/look2.py")



More information about the Pypy-commit mailing list