diff options
| author | Sebastian Heinlein <sebi@sebi-laptop> | 2007-02-26 19:51:30 +0100 |
|---|---|---|
| committer | Sebastian Heinlein <sebi@sebi-laptop> | 2007-02-26 19:51:30 +0100 |
| commit | 7878cb9047d781694852cf5555294daa6814a799 (patch) | |
| tree | c144d800b2455ec07da8522a585a685cfea656e8 /python | |
| parent | 6e9b3a9bd697061e0a556af8e64abb8f388639a0 (diff) | |
| parent | 8e179c8fd3b02b0dacac7ecbfbd08447d9c9ba43 (diff) | |
| download | python-apt-7878cb9047d781694852cf5555294daa6814a799.tar.gz | |
* merge with mvo
Diffstat (limited to 'python')
| -rw-r--r-- | python/string.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/python/string.cc b/python/string.cc index 16adc8cd..d0926da5 100644 --- a/python/string.cc +++ b/python/string.cc @@ -53,9 +53,11 @@ PyObject *StrSizeToStr(PyObject *Self,PyObject *Args) if (PyArg_ParseTuple(Args,"O",&Obj) == 0) return 0; if (PyInt_Check(Obj)) - return CppPyString(SizeToStr(PyInt_AS_LONG(Obj))); + return CppPyString(SizeToStr(PyInt_AsLong(Obj))); + if (PyLong_Check(Obj)) + return CppPyString(SizeToStr(PyLong_AsLong(Obj))); if (PyFloat_Check(Obj)) - return CppPyString(SizeToStr(PyFloat_AS_DOUBLE(Obj))); + return CppPyString(SizeToStr(PyFloat_AsDouble(Obj))); PyErr_SetString(PyExc_TypeError,"Only understand integers and floats"); return 0; |
