diff options
| -rw-r--r-- | python/acquire-item.cc | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/python/acquire-item.cc b/python/acquire-item.cc index 377b077a..895d4a21 100644 --- a/python/acquire-item.cc +++ b/python/acquire-item.cc @@ -160,14 +160,19 @@ static PyObject *acquireitem_repr(PyObject *Self) pkgAcquire::Item *Itm = acquireitem_tocpp(Self); if (Itm == 0) return 0; - return PyString_FromFormat("<%s object: " - "Status: %i Complete: %i Local: %i IsTrusted: %i " - "FileSize: %llu DestFile:'%s' " - "DescURI: '%s' ID:%lu ErrorText: '%s'>", - Self->ob_type->tp_name, - Itm->Status, Itm->Complete, Itm->Local, Itm->IsTrusted(), - Itm->FileSize, Itm->DestFile.c_str(), Itm->DescURI().c_str(), - Itm->ID,Itm->ErrorText.c_str()); + // FIXME: once python 2.7 is default we can use: + // return PyString_FromFormat() + // but for < 2.7 the "%llu" is not supported + string repr; + strprintf(repr, "<%s object:" + "Status: %i Complete: %i Local: %i IsTrusted: %i " + "FileSize: %llu DestFile:'%s' " + "DescURI: '%s' ID:%lu ErrorText: '%s'>", + Self->ob_type->tp_name, + Itm->Status, Itm->Complete, Itm->Local, Itm->IsTrusted(), + Itm->FileSize, Itm->DestFile.c_str(), Itm->DescURI().c_str(), + Itm->ID,Itm->ErrorText.c_str()); + return CppPyString(repr); } static void acquireitem_dealloc(PyObject *self) |
