diff options
| author | Michael Vogt <egon@bottom> | 2007-05-02 18:43:13 +0200 |
|---|---|---|
| committer | Michael Vogt <egon@bottom> | 2007-05-02 18:43:13 +0200 |
| commit | 500e805d3fa7faee957e67410f525435224f1e21 (patch) | |
| tree | fad6c63e9aa28d7df2effe7d378923e05cf2db10 /python/string.cc | |
| parent | a231ca12f5fbb6adb55142973eb4d7a284763ace (diff) | |
| parent | cccfb88edd8dd82348ff89f96a0b26ac815b483c (diff) | |
| download | python-apt-500e805d3fa7faee957e67410f525435224f1e21.tar.gz | |
* merged from python-apt--mvo
Diffstat (limited to 'python/string.cc')
| -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; |
