[pypy-commit] pypy default: Disable the PyPy-only warning in ctypes for now.

arigo noreply at buildbot.pypy.org
Sat Apr 6 11:45:32 CEST 2013


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r63098:17f9426edda9
Date: 2013-04-06 11:45 +0200
http://bitbucket.org/pypy/pypy/changeset/17f9426edda9/

Log:	Disable the PyPy-only warning in ctypes for now.

diff --git a/lib_pypy/_ctypes/function.py b/lib_pypy/_ctypes/function.py
--- a/lib_pypy/_ctypes/function.py
+++ b/lib_pypy/_ctypes/function.py
@@ -8,7 +8,6 @@
 import _ffi
 import sys
 import traceback
-import warnings
 
 try: from __pypy__ import builtinify
 except ImportError: builtinify = lambda f: f
@@ -315,8 +314,12 @@
             return
 
         if argtypes is None:
-            warnings.warn('C function without declared arguments called',
-                          RuntimeWarning, stacklevel=2)
+            # XXX this warning was originally meaning "it's going to be
+            # really slow".  Now we don't worry that much about slowness
+            # of ctypes, and it's strange to get warnings for perfectly-
+            # legal code.
+            #warnings.warn('C function without declared arguments called',
+            #              RuntimeWarning, stacklevel=2)
             argtypes = []
 
         if self._com_index:
diff --git a/pypy/module/test_lib_pypy/ctypes_tests/test_functions.py b/pypy/module/test_lib_pypy/ctypes_tests/test_functions.py
--- a/pypy/module/test_lib_pypy/ctypes_tests/test_functions.py
+++ b/pypy/module/test_lib_pypy/ctypes_tests/test_functions.py
@@ -510,6 +510,7 @@
         assert seen == ["yadda"]
 
     def test_warnings(self):
+        py.test.skip("warnings are disabled")
         import warnings
         warnings.simplefilter("always")
         with warnings.catch_warnings(record=True) as w:


More information about the pypy-commit mailing list