diff options
| author | Neal Norwitz <nnorwitz@gmail.com> | 2008-02-24 02:20:25 (GMT) | 
|---|---|---|
| committer | Neal Norwitz <nnorwitz@gmail.com> | 2008-02-24 02:20:25 (GMT) | 
| commit | 53152a1905147e50ee38ff681252292e90ee7474 (patch) | |
| tree | b24b60b1b367a7b39b49c1da70747c4a29054070 /Python/bltinmodule.c | |
| parent | 8c460d52417e764fc21362087b9314dbc09039bd (diff) | |
| download | cpython-53152a1905147e50ee38ff681252292e90ee7474.zip cpython-53152a1905147e50ee38ff681252292e90ee7474.tar.gz cpython-53152a1905147e50ee38ff681252292e90ee7474.tar.bz2  | |
map(None, ...) is not supported in 3.0.
Diffstat (limited to 'Python/bltinmodule.c')
| -rw-r--r-- | Python/bltinmodule.c | 12 | 
1 files changed, 9 insertions, 3 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 71beeba..648637d 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -909,9 +909,15 @@ builtin_map(PyObject *self, PyObject *args)  	func = PyTuple_GetItem(args, 0);  	n--; -	if (func == Py_None && n == 1) { -		/* map(None, S) is the same as list(S). */ -		return PySequence_List(PyTuple_GetItem(args, 1)); +	if (func == Py_None) { +		if (Py_Py3kWarningFlag && +		    PyErr_Warn(PyExc_DeprecationWarning,  +			       "map(None, ...) not supported in 3.x") < 0) +			return NULL; +		if (n == 1) { +			/* map(None, S) is the same as list(S). */ +			return PySequence_List(PyTuple_GetItem(args, 1)); +		}  	}  	/* Get space for sequence descriptors.  Must NULL out the iterator  | 
