[Python-checkins] r58611 - in python/branches/ctypes-branch: Lib/ctypes/test/test_callbacks.py Modules/_ctypes/cfield.c

thomas.heller python-checkins at python.org
Tue Oct 23 20:23:43 CEST 2007


Author: thomas.heller
Date: Tue Oct 23 20:23:42 2007
New Revision: 58611

Modified:
   python/branches/ctypes-branch/Lib/ctypes/test/test_callbacks.py
   python/branches/ctypes-branch/Modules/_ctypes/cfield.c
Log:
Remove the debug prints, they do not help to find the bugs.

Modified: python/branches/ctypes-branch/Lib/ctypes/test/test_callbacks.py
==============================================================================
--- python/branches/ctypes-branch/Lib/ctypes/test/test_callbacks.py	(original)
+++ python/branches/ctypes-branch/Lib/ctypes/test/test_callbacks.py	Tue Oct 23 20:23:42 2007
@@ -1,5 +1,4 @@
 import unittest
-import sys
 from ctypes import *
 import _ctypes_test
 
@@ -79,14 +78,8 @@
         self.check_type(c_double, -3.14)
 
     def test_longdouble(self):
-        print >> sys.stderr, "First Test Start"
         self.check_type(c_longdouble, 3.14)
-        print  >> sys.stderr, "First Test Done"
-        print >> sys.stderr
-
-        print  >> sys.stderr, "Second Test Start"
-        self.check_type(c_longdouble, 2.78)
-        print  >> sys.stderr, "Second Test Done"
+        self.check_type(c_longdouble, -3.14)
 
     def test_char(self):
         self.check_type(c_char, "x")

Modified: python/branches/ctypes-branch/Modules/_ctypes/cfield.c
==============================================================================
--- python/branches/ctypes-branch/Modules/_ctypes/cfield.c	(original)
+++ python/branches/ctypes-branch/Modules/_ctypes/cfield.c	Tue Oct 23 20:23:42 2007
@@ -993,7 +993,7 @@
 D_set(void *ptr, PyObject *value, Py_ssize_t size)
 {
 	long double x;
-	int i;
+
 	x = PyFloat_AsDouble(value);
 	if (x == -1 && PyErr_Occurred()) {
 		PyErr_Format(PyExc_TypeError,
@@ -1002,10 +1002,6 @@
 		return NULL;
 	}
 	memcpy(ptr, &x, sizeof(long double));
-	fprintf(stderr, "D_set(%p, %f) (", ptr, (float)x);
-	for (i = 0; i < sizeof(long double); ++i)
-		fprintf(stderr, "%02x ", ((char *)ptr)[i] & 0xFF);
-	fprintf(stderr, ")\n");
 	_RET(value);
 }
 
@@ -1013,12 +1009,7 @@
 D_get(void *ptr, Py_ssize_t size)
 {
 	long double val;
-	int i;
 	memcpy(&val, ptr, sizeof(long double));
-	fprintf(stderr, "D_get(%p) %f  (", ptr, (float)val);
-	for (i = 0; i < sizeof(long double); ++i)
-		fprintf(stderr, "%02x ", ((char *)ptr)[i] & 0xFF);
-	fprintf(stderr, ")\n");
 	return PyFloat_FromDouble(val);
 }
 


More information about the Python-checkins mailing list