comparison Python/bltinmodule.c @ 45880:ee0dfccf8cee legacy-trunk

Added a warning when -3 is enabled and None is passed to filter as the first argument.
author David Wolever <david@wolever.net>
date Tue, 18 Mar 2008 21:20:25 +0000
parents 5c0b5cabeec9
children 727f743cf630
comparison
equal deleted inserted replaced
45879:2f640f0f0697 45880:ee0dfccf8cee
294 goto Fail_result_it; 294 goto Fail_result_it;
295 break; 295 break;
296 } 296 }
297 297
298 if (func == (PyObject *)&PyBool_Type || func == Py_None) { 298 if (func == (PyObject *)&PyBool_Type || func == Py_None) {
299 if (Py_Py3kWarningFlag &&
300 PyErr_Warn(PyExc_DeprecationWarning,
301 "filter with None as a first argument "
302 "is not supported in 3.x. Use a list "
303 "comprehension instead.") < 0)
304 return NULL;
305
299 ok = PyObject_IsTrue(item); 306 ok = PyObject_IsTrue(item);
300 } 307 }
301 else { 308 else {
302 PyObject *good; 309 PyObject *good;
303 PyTuple_SET_ITEM(arg, 0, item); 310 PyTuple_SET_ITEM(arg, 0, item);