diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2010-09-28 15:35:01 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2010-09-28 15:35:01 +0200 |
| commit | 2d771cd542128fa347c353ddb6cdad5a684652f3 (patch) | |
| tree | 7cc09826b090c9a2f6637776dd525367f59f0420 | |
| parent | 9c9e4973bc5051a75b8b6c4f94be20fef5e881df (diff) | |
| download | python-apt-2d771cd542128fa347c353ddb6cdad5a684652f3.tar.gz | |
python/acquire-item.cc: strprintf() to have a working %llu
| -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) |
