summaryrefslogtreecommitdiff
path: root/python/string.cc
diff options
context:
space:
mode:
authorMichael Vogt <egon@bottom>2007-05-02 18:43:13 +0200
committerMichael Vogt <egon@bottom>2007-05-02 18:43:13 +0200
commit500e805d3fa7faee957e67410f525435224f1e21 (patch)
treefad6c63e9aa28d7df2effe7d378923e05cf2db10 /python/string.cc
parenta231ca12f5fbb6adb55142973eb4d7a284763ace (diff)
parentcccfb88edd8dd82348ff89f96a0b26ac815b483c (diff)
downloadpython-apt-500e805d3fa7faee957e67410f525435224f1e21.tar.gz
* merged from python-apt--mvo
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;