commit | 8e42a0a0e0358c2004c33e0c7415ca48874df991 | [log] [tgz] |
---|---|---|
author | Christian Heimes <christian@cheimes.de> | Thu Nov 08 18:04:45 2007 +0000 |
committer | Christian Heimes <christian@cheimes.de> | Thu Nov 08 18:04:45 2007 +0000 |
tree | 79d6df5b01ae1da021d2776d085186742dfd774a | |
parent | 8bd14fb398b1b89c82defdac6c5755c9ca86859b [diff] |
Fixed bug #1081: file.seek allows float arguments
diff --git a/Modules/_fileio.c b/Modules/_fileio.c index c357a73..0fd8b66 100644 --- a/Modules/_fileio.c +++ b/Modules/_fileio.c
@@ -556,6 +556,10 @@ if (posobj == NULL) pos = 0; else { + if(PyFloat_Check(posobj)) { + PyErr_SetString(PyExc_TypeError, "an integer is required"); + return NULL; + } #if !defined(HAVE_LARGEFILE_SUPPORT) pos = PyInt_AsLong(posobj); #else