summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2010-03-05 14:50:22 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2010-03-05 14:50:22 (GMT)
commit20d7f6e8f4b3f8f2a047268d46ca63e0961690ad (patch)
tree3fc0330f19542b05a8fa3119aab9b5d8ff17f85f /Modules
parent1c0c78c61f440de7187f62ecdd1cc828f0a2e95e (diff)
downloadcpython-20d7f6e8f4b3f8f2a047268d46ca63e0961690ad.zip
cpython-20d7f6e8f4b3f8f2a047268d46ca63e0961690ad.tar.gz
cpython-20d7f6e8f4b3f8f2a047268d46ca63e0961690ad.tar.bz2
Remove the redundant #define: PY_STRUCT_FLOAT_COERCE
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_struct.c13
1 files changed, 0 insertions, 13 deletions
diff --git a/Modules/_struct.c b/Modules/_struct.c
index d7cc77f..97f2f75 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -17,15 +17,7 @@ static PyTypeObject PyStructType;
typedef int Py_ssize_t;
#endif
-/* If PY_STRUCT_FLOAT_COERCE is defined, the struct module will allow float
- arguments for integer formats with a warning for backwards
- compatibility. */
-
-#define PY_STRUCT_FLOAT_COERCE 1
-
-#ifdef PY_STRUCT_FLOAT_COERCE
#define FLOAT_COERCE "integer argument expected, got float"
-#endif
/* The translation function for each format character is table driven */
@@ -119,13 +111,11 @@ get_pylong(PyObject *v)
Py_INCREF(v);
return v;
}
-#ifdef PY_STRUCT_FLOAT_COERCE
if (PyFloat_Check(v)) {
if (PyErr_WarnEx(PyExc_DeprecationWarning, FLOAT_COERCE, 1)<0)
return NULL;
return PyNumber_Long(v);
}
-#endif
PyErr_SetString(StructError,
"cannot convert argument to long");
return NULL;
@@ -1972,8 +1962,5 @@ init_struct(void)
PyModule_AddObject(m, "__version__", ver);
PyModule_AddIntConstant(m, "_PY_STRUCT_RANGE_CHECKING", 1);
-#ifdef PY_STRUCT_FLOAT_COERCE
PyModule_AddIntConstant(m, "_PY_STRUCT_FLOAT_COERCE", 1);
-#endif
-
}