[pypy-commit] pypy default: fix test_urandom_failure by eliminating unnecessary dependency ctypes_support -> ctypes.util -> tempfile -> random -> urandom
bdkearns
noreply at buildbot.pypy.org
Tue Apr 22 07:38:14 CEST 2014
Author: Brian Kearns <bdkearns at gmail.com>
Branch:
Changeset: r70843:ad57911bdbc4
Date: 2014-04-22 01:36 -0400
http://bitbucket.org/pypy/pypy/changeset/ad57911bdbc4/
Log: fix test_urandom_failure by eliminating unnecessary dependency
ctypes_support -> ctypes.util -> tempfile -> random -> urandom
diff --git a/lib-python/2.7/ctypes/util.py b/lib-python/2.7/ctypes/util.py
--- a/lib-python/2.7/ctypes/util.py
+++ b/lib-python/2.7/ctypes/util.py
@@ -86,9 +86,10 @@
elif os.name == "posix":
# Andreas Degert's find functions, using gcc, /sbin/ldconfig, objdump
- import re, tempfile, errno
+ import re, errno
def _findLib_gcc(name):
+ import tempfile
expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name)
fdout, ccout = tempfile.mkstemp()
os.close(fdout)
diff --git a/lib_pypy/ctypes_support.py b/lib_pypy/ctypes_support.py
--- a/lib_pypy/ctypes_support.py
+++ b/lib_pypy/ctypes_support.py
@@ -1,4 +1,3 @@
-
""" This file provides some support for things like standard_c_lib and
errno access, as portable as possible
"""
@@ -22,7 +21,7 @@
standard_c_lib._errno.argtypes = None
def _where_is_errno():
return standard_c_lib._errno()
-
+
elif sys.platform in ('linux2', 'freebsd6'):
standard_c_lib.__errno_location.restype = ctypes.POINTER(ctypes.c_int)
standard_c_lib.__errno_location.argtypes = None
@@ -42,5 +41,3 @@
def set_errno(value):
errno_p = _where_is_errno()
errno_p.contents.value = value
-
-
More information about the pypy-commit
mailing list