diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2007-02-22 17:11:51 +0100 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2007-02-22 17:11:51 +0100 |
| commit | 1c878fca17aaa7d8300224e1aed0f13066fe3e84 (patch) | |
| tree | 43caf44780b81a22e0fae20a4729abc675bf83e0 /python | |
| parent | d8f0eef84bc05f6e87ebf50bd8780accec03eacb (diff) | |
| download | python-apt-1c878fca17aaa7d8300224e1aed0f13066fe3e84.tar.gz | |
* apt/package.py:
- handle invalid unicode more gracefully (LP#86215)
* rebuild against latest apt
Diffstat (limited to 'python')
| -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; |
