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

pedronis at codespeak.net pedronis at codespeak.net
Wed Apr 13 21:57:22 CEST 2005


Author: pedronis
Date: Wed Apr 13 21:57:22 2005
New Revision: 10594

Modified:
   pypy/dist/pypy/objspace/flow/objspace.py
Log:
geninterplevel wants int(.) to be considered able to raise exceptions too



Modified: pypy/dist/pypy/objspace/flow/objspace.py
==============================================================================
--- pypy/dist/pypy/objspace/flow/objspace.py	(original)
+++ pypy/dist/pypy/objspace/flow/objspace.py	Wed Apr 13 21:57:22 2005
@@ -368,13 +368,13 @@
         exceptions = [Exception]   # *any* exception by default
         if isinstance(w_callable, Constant):
             c = w_callable.value
-            if isinstance(c, (types.BuiltinFunctionType,
-                              types.BuiltinMethodType)):
-                if not self.builtins_can_raise_exceptions:
+            if not self.builtins_can_raise_exceptions:
+                if isinstance(c, (types.BuiltinFunctionType,
+                                  types.BuiltinMethodType)):
+                    exceptions = None
+                elif (isinstance(c, (type, types.ClassType)) and
+                      c.__module__ in ['__builtin__', 'exceptions']):
                     exceptions = None
-            elif (isinstance(c, (type, types.ClassType)) and
-                  c.__module__ in ['__builtin__', 'exceptions']):
-                exceptions = None
         self.handle_implicit_exceptions(exceptions)
         return w_res
 



More information about the Pypy-commit mailing list