[py-svn] r18846 - py/dist/py/misc

arigo at codespeak.net arigo at codespeak.net
Sun Oct 23 21:38:37 CEST 2005


Author: arigo
Date: Sun Oct 23 21:38:36 2005
New Revision: 18846

Modified:
   py/dist/py/misc/error.py
Log:
Make this work even if exceptions are new-style (as in PyPy, and probably
as in CPython at some point).


Modified: py/dist/py/misc/error.py
==============================================================================
--- py/dist/py/misc/error.py	(original)
+++ py/dist/py/misc/error.py	Sun Oct 23 21:38:36 2005
@@ -43,7 +43,7 @@
             return _errno2class[eno]
         except KeyError:
             clsname = py.std.errno.errorcode.get(eno, "UnknownErrno%d" %(eno,))
-            cls = py.std.new.classobj(clsname, (Error,),
+            cls = type(Error)(clsname, (Error,),
                     {'__module__':'py.error',
                      '__doc__': py.std.os.strerror(eno)})
             _errno2class[eno] = cls



More information about the pytest-commit mailing list