[pypy-svn] r20842 - pypy/dist/pypy/interpreter

ludal at codespeak.net ludal at codespeak.net
Wed Dec 7 16:33:52 CET 2005


Author: ludal
Date: Wed Dec  7 16:33:49 2005
New Revision: 20842

Modified:
   pypy/dist/pypy/interpreter/pycompiler.py
Log:
don't touch the exception we just let the OperationError propagate from the callback to applevel
again


Modified: pypy/dist/pypy/interpreter/pycompiler.py
==============================================================================
--- pypy/dist/pypy/interpreter/pycompiler.py	(original)
+++ pypy/dist/pypy/interpreter/pycompiler.py	Wed Dec  7 16:33:49 2005
@@ -219,15 +219,10 @@
             raise OperationError(space.w_SyntaxError,
                                  e.wrap_info(space, filename))
 
-	try:
-	    if self.compile_hook is not None:
-		new_tree = space.call_function(self.compile_hook,
-                                               space.wrap(ast_tree),
-                                               space.wrap(encoding))
-	except Exception, e:
-            # XXX find a better way to handle exceptions at this point
-            raise OperationError(space.w_Exception,
-                                 space.wrap(str(e)))
+	if self.compile_hook is not None:
+	    new_tree = space.call_function(self.compile_hook,
+					   space.wrap(ast_tree),
+					   space.wrap(encoding))
         try:
             astcompiler.misc.set_filename(filename, ast_tree)
             flag_names = get_flag_names(space, flags)
@@ -250,9 +245,10 @@
         return c
 
 
-
 def install_compiler_hook(space, w_callable):
     if space.is_w(w_callable, space.w_None):
 	space.default_compiler.compile_hook = None
     else:
+#       if not space.get( w_callable ):
+#	    raise OperationError( space.w_TypeError( space.wrap( "must have a callable" ) )
         space.default_compiler.compile_hook = w_callable



More information about the Pypy-commit mailing list