[pypy-svn] r50282 - pypy/dist/pypy/rpython/lltypesystem

fijal at codespeak.net fijal at codespeak.net
Thu Jan 3 10:46:12 CET 2008


Author: fijal
Date: Thu Jan  3 10:46:11 2008
New Revision: 50282

Modified:
   pypy/dist/pypy/rpython/lltypesystem/rffi.py
Log:
(mwh) typo


Modified: pypy/dist/pypy/rpython/lltypesystem/rffi.py
==============================================================================
--- pypy/dist/pypy/rpython/lltypesystem/rffi.py	(original)
+++ pypy/dist/pypy/rpython/lltypesystem/rffi.py	Thu Jan  3 10:46:11 2008
@@ -151,11 +151,24 @@
         errorcode = callable._errorcode_
     else:
         errorcode = TP.TO.RESULT._example()
+    if aroundstate is not None:
+        before = aroundstate.before
+        after = aroundstate.after
+    else:
+        before = None
+        after = None
     def wrapper(*args):
         try:
-            return callable(*args)
+            if before:
+                before()
+            result = callable(*args)
+            if after:
+                after()
+            return result
         except Exception, e:
-            os.write(2, "Warning: uncatched exception in callback: %s %s\n" % (str(callable), str(e)))
+            if after:
+                after()
+            os.write(2, "Warning: uncaught exception in callback: %s %s\n" % (str(callable), str(e)))
             return errorcode
     return wrapper
 _make_wrapper_for._annspecialcase_ = 'specialize:memo'



More information about the Pypy-commit mailing list