summaryrefslogtreecommitdiff
path: root/lorry.zip-importer
diff options
context:
space:
mode:
authorBen Hutchings <ben.hutchings@codethink.co.uk>2020-05-04 20:18:29 +0100
committerBen Hutchings <ben.hutchings@codethink.co.uk>2020-05-29 20:35:30 +0100
commit6c2ff9ff07c8fa4c4b4ecd0e40dbb9acc1c516c3 (patch)
tree4d25457b6eaa42cc2623aed8099b68110e096c9c /lorry.zip-importer
parenteebf790e2909ff39974e0db42fdfa9a98dbecbcf (diff)
downloadlorry-6c2ff9ff07c8fa4c4b4ecd0e40dbb9acc1c516c3.tar.gz
lorry.zip-importer: Fix time comparisons for Python 3
lorry.zip-importer sets commit_time to the latest timestamp found in the zip file. It initialises it to 0 and then compares with each timestamp, which is a tuple. In Python 3, there is no ordering between int and tuple values, so this raises an exception. Change the initial value to be a tuple so that the comparisons work. This also allows importing empty zip files, though that doesn't seem particularly useful.
Diffstat (limited to 'lorry.zip-importer')
-rwxr-xr-xlorry.zip-importer2
1 files changed, 1 insertions, 1 deletions
diff --git a/lorry.zip-importer b/lorry.zip-importer
index 10b3b2b..cab5e26 100755
--- a/lorry.zip-importer
+++ b/lorry.zip-importer
@@ -28,7 +28,7 @@ def export(zipfile, fast_import):
for str in list:
fast_import.write(str.encode('utf-8') + b"\n")
- commit_time = 0
+ commit_time = (1970, 1, 1, 0, 0, 0)
next_mark = 1
common_prefix = None
mark = dict()