summaryrefslogtreecommitdiff
path: root/python/string.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2011-04-11 11:44:20 +0200
committerJulian Andres Klode <jak@debian.org>2011-04-11 11:44:20 +0200
commit2a0f97e8ad0ed8ac7456b8dc785071bf1c3a1847 (patch)
treeb3f79e26025f4add4b9fa2aa163db9931f7de62b /python/string.cc
parentd5e763e1920eadf0bc0d460abbf686c65db2a3b4 (diff)
downloadpython-apt-2a0f97e8ad0ed8ac7456b8dc785071bf1c3a1847.tar.gz
apt_pkg: Fix time_to_str, time_rfc1123 to accept more correct values
(time_to_str accepts unsigned long, time_rfc1123 long long, y2k31-correct).
Diffstat (limited to 'python/string.cc')
-rw-r--r--python/string.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/python/string.cc b/python/string.cc
index 6a1ce4e2..a5016103 100644
--- a/python/string.cc
+++ b/python/string.cc
@@ -28,11 +28,11 @@ PyObject *Python(PyObject *Self,PyObject *Args) \
return CppPyString(CFunc(Str)); \
}
-#define MkInt(Python,CFunc) \
+#define MkInt(Python,CFunc, ctype, pytype) \
PyObject *Python(PyObject *Self,PyObject *Args) \
{ \
- int Val = 0; \
- if (PyArg_ParseTuple(Args,"i",&Val) == 0) \
+ ctype Val = 0; \
+ if (PyArg_ParseTuple(Args,pytype,&Val) == 0) \
return 0; \
return CppPyString(CFunc(Val)); \
}
@@ -56,8 +56,8 @@ PyObject *StrBase64Encode(PyObject *Self,PyObject *Args) {
MkStr(StrURItoFileName,URItoFileName);
//MkFloat(StrSizeToStr,SizeToStr);
-MkInt(StrTimeToStr,TimeToStr);
-MkInt(StrTimeRFC1123,TimeRFC1123);
+MkInt(StrTimeToStr,TimeToStr, unsigned long, "k");
+MkInt(StrTimeRFC1123,TimeRFC1123, long long, "L");
/*}}}*/
// Other String functions /*{{{*/