[pypy-commit] pypy default: Fix oofakeimpls for math functions which I broke with my fmod commit (where I condensced some code).

alex_gaynor noreply at buildbot.pypy.org
Sat Aug 27 18:55:11 CEST 2011


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: 
Changeset: r46823:f72d34060e0c
Date: 2011-08-27 12:54 -0400
http://bitbucket.org/pypy/pypy/changeset/f72d34060e0c/

Log:	Fix oofakeimpls for math functions which I broke with my fmod commit
	(where I condensced some code).

diff --git a/pypy/rpython/extfuncregistry.py b/pypy/rpython/extfuncregistry.py
--- a/pypy/rpython/extfuncregistry.py
+++ b/pypy/rpython/extfuncregistry.py
@@ -56,10 +56,16 @@
 for module, methods in _register:
     for name, arg_types, return_type in methods:
         method_name = 'll_math_%s' % name
+        oofake = None
+        # Things with a tuple return type have a fake impl for RPython, check
+        # to see if the method has one.
+        if hasattr(oo_math, method_name):
+          oofake = getattr(oo_math, method_name)
         register_external(getattr(module, name), arg_types, return_type,
                           export_name='ll_math.%s' % method_name,
                           sandboxsafe=True,
-                          llimpl=getattr(ll_math, method_name))
+                          llimpl=getattr(ll_math, method_name),
+                          oofakeimpl=oofake)
 
 # ___________________________
 # os.path functions


More information about the pypy-commit mailing list