[pypy-svn] r76093 - in pypy/branch/fast-forward/pypy/rpython: . lltypesystem/module

benjamin at codespeak.net benjamin at codespeak.net
Sat Jul 10 19:06:44 CEST 2010


Author: benjamin
Date: Sat Jul 10 19:06:43 2010
New Revision: 76093

Modified:
   pypy/branch/fast-forward/pypy/rpython/extfuncregistry.py
   pypy/branch/fast-forward/pypy/rpython/lltypesystem/module/ll_math.py
Log:
register new math functions

Modified: pypy/branch/fast-forward/pypy/rpython/extfuncregistry.py
==============================================================================
--- pypy/branch/fast-forward/pypy/rpython/extfuncregistry.py	(original)
+++ pypy/branch/fast-forward/pypy/rpython/extfuncregistry.py	Sat Jul 10 19:06:43 2010
@@ -22,7 +22,10 @@
 # and are part of math.h
 for name in ll_math.unary_math_functions:
     llimpl = getattr(ll_math, 'll_math_%s' % name, None)
-    f = getattr(math, name)
+    try:
+        f = getattr(math, name)
+    except AttributeError:
+        f = getattr(rarithmetic, name)
     register_external(f, [float], float,
                       export_name="ll_math.ll_math_%s" % name,
                        sandboxsafe=True, llimpl=llimpl)

Modified: pypy/branch/fast-forward/pypy/rpython/lltypesystem/module/ll_math.py
==============================================================================
--- pypy/branch/fast-forward/pypy/rpython/lltypesystem/module/ll_math.py	(original)
+++ pypy/branch/fast-forward/pypy/rpython/lltypesystem/module/ll_math.py	Sat Jul 10 19:06:43 2010
@@ -316,7 +316,7 @@
     'acos', 'asin', 'atan',
     'ceil', 'cos', 'cosh', 'exp', 'fabs', 'floor',
     'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'log', 'log10',
-    'acosh', 'asinh', 'atanh',   # -- added in Python 2.6
+    'acosh', 'asinh', 'atanh', 'log1p', 'expm1'  # -- added in Python 2.6
     ]
 unary_math_functions_can_overflow = [
     'cosh', 'exp', 'log1p', 'sinh', 'expm1',



More information about the Pypy-commit mailing list