diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2007-02-22 15:31:00 +0100 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2007-02-22 15:31:00 +0100 |
| commit | fb94875bd4e108c6d22e05d5312de7ed9f86b057 (patch) | |
| tree | 7bf9742f184310820922f7465a33578b7af28384 | |
| parent | e2b1181b6600d5dfb1f5e1ebd31d89ee9229db8c (diff) | |
| download | python-apt-fb94875bd4e108c6d22e05d5312de7ed9f86b057.tar.gz | |
* python/string.cc:
- SizeToString supports PyLong too
| -rw-r--r-- | debian/changelog | 2 | ||||
| -rw-r--r-- | python/string.cc | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog index da487377..7833dc00 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ python-apt (0.6.21) unstable; urgency=low * apt/cdrom.py: - better cdrom handling support + * python/string.cc: + - SizeToString supports PyLong too -- 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; |
