cpython: 4ef048f4834e (original) (raw)
Mercurial > cpython
changeset 82147:4ef048f4834e 3.3
Reject float as uid or gid. A regression was introduced in the commit for issue issue #4591. [#4591]
Serhiy Storchaka storchaka@gmail.com | |
---|---|
date | Sun, 10 Feb 2013 23:28:02 +0200 |
parents | b322655a4a88 |
children | 3fdcffdfd3e6 b8d7e385553d |
files | Modules/posixmodule.c |
diffstat | 1 files changed, 14 insertions(+), 2 deletions(-)[+] [-] Modules/posixmodule.c 16 |
line wrap: on
line diff
--- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -437,7 +437,13 @@ int _Py_Uid_Converter(PyObject *obj, void *p) { int overflow;
- long result;
- if (PyFloat_Check(obj)) {
PyErr_SetString(PyExc_TypeError,[](#l1.10)
"integer argument expected, got float");[](#l1.11)
return 0;[](#l1.12)
- }
- result = PyLong_AsLongAndOverflow(obj, &overflow); if (overflow < 0) goto OverflowDown; if (!overflow && result == -1) { @@ -485,7 +491,13 @@ int _Py_Gid_Converter(PyObject *obj, void *p) { int overflow;