Mercurial > cpython-lru_cache-weakref
diff Modules/_cursesmodule.c @ 40626:4aee3f672f77
Merged the int/long unification branch, by very crude means (sorry Thomas!).
I banged on the code (beyond what's in that branch) to make fewer tests fail;
the only tests that fail now are:
test_descr -- can't pickle ints?!
test_pickletools -- ???
test_socket -- See python.org/sf/1619659
test_sqlite -- ???
I'll deal with those later.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Sun, 14 Jan 2007 03:31:43 +0000 |
| parents | cc992d75d5b3 |
| children | 06145fbc7ab9 |
line wrap: on
line diff
--- a/Modules/_cursesmodule.c Sat Jan 13 23:54:39 2007 +0000 +++ b/Modules/_cursesmodule.c Sun Jan 14 03:31:43 2007 +0000 @@ -193,7 +193,7 @@ static int PyCurses_ConvertToChtype(PyObject *obj, chtype *ch) { - if (PyInt_Check(obj)) { + if (PyInt_CheckExact(obj)) { *ch = (chtype) PyInt_AsLong(obj); } else if(PyString_Check(obj) && (PyString_Size(obj) == 1)) { @@ -2364,7 +2364,7 @@ if (!PyArg_ParseTuple(args,"O;ch or int",&temp)) return NULL; - if (PyInt_Check(temp)) + if (PyInt_CheckExact(temp)) ch = (chtype) PyInt_AsLong(temp); else if (PyString_Check(temp)) ch = (chtype) *PyString_AsString(temp); @@ -2386,7 +2386,7 @@ if (!PyArg_ParseTuple(args,"O;ch or int",&temp)) return NULL; - if (PyInt_Check(temp)) + if (PyInt_CheckExact(temp)) ch = (int) PyInt_AsLong(temp); else if (PyString_Check(temp)) ch = (int) *PyString_AsString(temp);
