[pypy-svn] r33902 - pypy/dist/pypy/objspace/flow

cfbolz at codespeak.net cfbolz at codespeak.net
Mon Oct 30 15:59:25 CET 2006


Author: cfbolz
Date: Mon Oct 30 15:59:24 2006
New Revision: 33902

Modified:
   pypy/dist/pypy/objspace/flow/objspace.py
Log:
raise an KeyboardInterrupt when interrupting the flowing of a function with
<Ctrl-C>


Modified: pypy/dist/pypy/objspace/flow/objspace.py
==============================================================================
--- pypy/dist/pypy/objspace/flow/objspace.py	(original)
+++ pypy/dist/pypy/objspace/flow/objspace.py	Mon Oct 30 15:59:24 2006
@@ -454,6 +454,15 @@
                  raise flowcontext.ImplicitOperationError(w_exc_cls,
                                                          w_exc_value)
 
+    def w_KeyboardInterrupt(self):
+        # XXX XXX Ha Ha
+        # the reason to do this is: if you interrupt the flowing of a function
+        # with <Ctrl-C> the bytecode interpreter will raise an applevel
+        # KeyboardInterrup and you will get an AttributeError: space does not
+        # have w_KeyboardInterrupt, which is not very helpful
+        raise KeyboardInterrupt
+    w_KeyboardInterrupt = property(w_KeyboardInterrupt)
+
 # the following gives us easy access to declare more for applications:
 NOT_REALLY_CONST = {
     Constant(sys): {



More information about the Pypy-commit mailing list