File: 010_migrate-to-python3.patch

package info (click to toggle)
recoverjpeg 2.6.3-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 232 kB
  • sloc: ansic: 403; cpp: 129; sh: 51; python: 22; makefile: 17
file content (34 lines) | stat: -rw-r--r-- 1,127 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Description: migrate script from Python2 to Python3.
 Made with a little help of 2to3 script.
Author: Joao Eriberto Mota Filho <eriberto@debian.org>
Bug-Debian: https://bugs.debian.org/938342
Forwarded: https://github.com/samueltardieu/recoverjpeg/pull/14
Last-Update: 2020-01-03
Index: recoverjpeg/scripts/remove-duplicates
===================================================================
--- recoverjpeg.orig/scripts/remove-duplicates
+++ recoverjpeg/scripts/remove-duplicates
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#! /usr/bin/python3
 #
 # Usage: remove-duplicates
 #
@@ -14,7 +14,7 @@ import os
 def check_duplicate(orig, copy):
     try:
         if open(orig).read() == open(copy).read():
-            print("Removing %s which is a copy of %s" % (copy, orig))
+            print(("Removing %s which is a copy of %s" % (copy, orig)))
             os.unlink(copy)
     except:
         pass
@@ -28,7 +28,7 @@ def aggregate():
     return d
 
 def remove_duplicates(d):
-    for v in d.values():
+    for v in list(d.values()):
         while v:
             del v[0]
             for c in v[1:]: check_duplicate(v[0], c)