From 50ae5ef4aa5d228805f5b832f2311a9b88bce875 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Mon, 4 Sep 2017 12:59:19 +0300 Subject: [PATCH] time: Add dummy struct_time constructor. CPython compatibility. As we don't have a proper struct_time, and use tuple instead, the constructor is identity function. --- time/time.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/time/time.py b/time/time.py index d811289c..69848a1e 100644 --- a/time/time.py +++ b/time/time.py @@ -25,6 +25,9 @@ def _c_tm_to_tuple(tm): t = ustruct.unpack("@iiiiiiiii", tm) return tuple([t[5] + 1900, t[4] + 1, t[3], t[2], t[1], t[0], (t[6] - 1) % 7, t[7] + 1, t[8]]) +def struct_time(tm): + return tm + def strftime(format, t=None): if t is None: