Author: Philip Jenvey <[email protected]>
Branch:
Changeset: r68398:f2a17348e70d
Date: 2013-12-07 12:01 -0800
http://bitbucket.org/pypy/pypy/changeset/f2a17348e70d/
Log: cleanup
diff --git a/rpython/rtyper/lltypesystem/module/ll_math.py
b/rpython/rtyper/lltypesystem/module/ll_math.py
--- a/rpython/rtyper/lltypesystem/module/ll_math.py
+++ b/rpython/rtyper/lltypesystem/module/ll_math.py
@@ -1,16 +1,16 @@
+import errno
import math
-import errno
import py
import sys
-from rpython.rtyper.lltypesystem import lltype, rffi
-from rpython.tool.sourcetools import func_with_new_name
from rpython.conftest import cdir
from rpython.rlib import jit, rposix
+from rpython.rlib.rfloat import INFINITY, NAN, isfinite, isinf, isnan
+from rpython.rtyper.lltypesystem import lltype, rffi
+from rpython.rtyper.module.support import UNDERSCORE_ON_WIN32
+from rpython.tool.sourcetools import func_with_new_name
from rpython.translator.tool.cbuild import ExternalCompilationInfo
from rpython.translator.platform import platform
-from rpython.rlib.rfloat import isfinite, isinf, isnan, INFINITY, NAN
-from rpython.rtyper.module.support import UNDERSCORE_ON_WIN32
use_library_isinf_isnan = False
if sys.platform == "win32":
@@ -19,8 +19,8 @@
# It's no more possible to take the address of some math functions.
# Ensure that the compiler chooses real functions instead.
eci = ExternalCompilationInfo(
- includes = ['math.h', 'float.h'],
- post_include_bits = ['#pragma function(floor)'],
+ includes=['math.h', 'float.h'],
+ post_include_bits=['#pragma function(floor)'],
)
use_library_isinf_isnan = True
else:
@@ -28,8 +28,8 @@
# Some math functions are C99 and not defined by the Microsoft compiler
cdir = py.path.local(cdir)
math_eci = ExternalCompilationInfo(
- include_dirs = [cdir],
- includes = ['src/ll_math.h'],
+ include_dirs=[cdir],
+ includes=['src/ll_math.h'],
separate_module_files=[cdir.join('src', 'll_math.c')],
export_symbols=['_pypy_math_acosh', '_pypy_math_asinh',
'_pypy_math_atanh',
@@ -111,8 +111,8 @@
while VERY_LARGE_FLOAT * 100.0 != INFINITY:
VERY_LARGE_FLOAT *= 64.0
-_lib_isnan = llexternal("_isnan", [lltype.Float], lltype.Signed)
-_lib_finite = llexternal("_finite", [lltype.Float], lltype.Signed)
+_lib_isnan = llexternal('_isnan', [lltype.Float], lltype.Signed)
+_lib_finite = llexternal('_finite', [lltype.Float], lltype.Signed)
def ll_math_isnan(y):
# By not calling into the external function the JIT can inline this.
@@ -343,7 +343,7 @@
def ll_math_sqrt(x):
if x < 0.0:
- raise ValueError, "math domain error"
+ raise ValueError("math domain error")
if isfinite(x):
return sqrt_nonneg(x)
@@ -431,4 +431,5 @@
for name in unary_math_functions:
can_overflow = name in unary_math_functions_can_overflow
c99 = name in unary_math_functions_c99
- globals()['ll_math_' + name] = new_unary_math_function(name, can_overflow,
c99)
+ globals()['ll_math_' + name] = new_unary_math_function(name, can_overflow,
+ c99)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit