summaryrefslogtreecommitdiff
path: root/python/string.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2007-02-22 15:31:00 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2007-02-22 15:31:00 +0100
commitfb94875bd4e108c6d22e05d5312de7ed9f86b057 (patch)
tree7bf9742f184310820922f7465a33578b7af28384 /python/string.cc
parente2b1181b6600d5dfb1f5e1ebd31d89ee9229db8c (diff)
downloadpython-apt-fb94875bd4e108c6d22e05d5312de7ed9f86b057.tar.gz
* python/string.cc:
- SizeToString supports PyLong too
Diffstat (limited to 'python/string.cc')
-rw-r--r--python/string.cc6
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;