summaryrefslogtreecommitdiff
path: root/python/string.cc
diff options
context:
space:
mode:
authorMichael Vogt <egon@bottom>2007-04-24 21:24:32 +0200
committerMichael Vogt <egon@bottom>2007-04-24 21:24:32 +0200
commitf83140ef276db00a2673e5085a40704f078a8cbd (patch)
treef2d65b5d4cc573b7dad4125a676788c19a7330ad /python/string.cc
parent82a6e0be9a632bc16e5c21b9c3ab0cce9a5b2a37 (diff)
parent6b02ff1915b3dcd098474e1b9ccd5f89d6b777da (diff)
downloadpython-apt-f83140ef276db00a2673e5085a40704f078a8cbd.tar.gz
* apt/cdrom.py:
- better cdrom handling support * apt/package.py: - added candidateDependencies, installedDependencies - SizeToString supports PyLong too - support pkg.architecture - support candidateRecord, installedRecord * apt/cache.py: - fix rootdir * apt/cdrom.py: - fix bug in cdrom mountpoint handling
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;