diff options
| author | Julian Andres Klode <jak@debian.org> | 2011-04-12 11:38:25 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2011-04-12 11:38:25 +0200 |
| commit | f441b008883170d6a8c4cfeb814b0c07a27e6afd (patch) | |
| tree | 6773ef5fec948428e98fd0a7bb6956372c21305f /python/tag.cc | |
| parent | 91603aac68593f6749428825d7e94b75873927f4 (diff) | |
| download | python-apt-f441b008883170d6a8c4cfeb814b0c07a27e6afd.tar.gz | |
apt_pkg: Fix unsigned/long-vs-int issues (LP: #610820)
This fix is large, but simple in concept. Instead of relying
on Py_BuildValue and type signatures, or type-specific
conversion functions, create a new set of overloaded
MkPyNumber() functions that automatically do the right
thing for each numerical type.
Diffstat (limited to 'python/tag.cc')
| -rw-r--r-- | python/tag.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/python/tag.cc b/python/tag.cc index 44cd06af..94554400 100644 --- a/python/tag.cc +++ b/python/tag.cc @@ -247,7 +247,7 @@ static PyObject *TagSecBytes(PyObject *Self,PyObject *Args) if (PyArg_ParseTuple(Args,"") == 0) return 0; - return Py_BuildValue("i",GetCpp<pkgTagSection>(Self).size()); + return MkPyNumber(GetCpp<pkgTagSection>(Self).size()); } static PyObject *TagSecStr(PyObject *Self) @@ -319,7 +319,8 @@ static PyObject *TagFileOffset(PyObject *Self,PyObject *Args) { if (PyArg_ParseTuple(Args,"") == 0) return 0; - return Py_BuildValue("i",((TagFileData *)Self)->Object.Offset()); + return MkPyNumber(((TagFileData *)Self)->Object.Offset()); + } static char *doc_Jump = |
