Hi,

attached is a debdiff which fixes the problem.

Since I'm not a DD/DM I would appreciate sponsors.

Cheers,
  Stefan.
diff -Nru fauhdlc-20180504/debian/changelog fauhdlc-20180504/debian/changelog
--- fauhdlc-20180504/debian/changelog   2019-03-09 23:58:44.000000000 +0100
+++ fauhdlc-20180504/debian/changelog   2019-12-04 20:21:21.000000000 +0100
@@ -1,3 +1,12 @@
+fauhdlc (20180504-3) unstable; urgency=medium
+
+  * debian/control: Update B-D from python to python3,
+    (Closes: #943007).
+  * debian/patches/0002-update-python.patch: Update interpreter
+    of testsuite to python3 for #934007.
+
+ -- Stefan Potyra <ste...@potyra.de>  Wed, 04 Dec 2019 20:21:21 +0100
+
 fauhdlc (20180504-2) unstable; urgency=medium
 
   [ Stefan Potyra ]
diff -Nru fauhdlc-20180504/debian/control fauhdlc-20180504/debian/control
--- fauhdlc-20180504/debian/control     2019-03-09 23:58:44.000000000 +0100
+++ fauhdlc-20180504/debian/control     2019-12-04 20:21:18.000000000 +0100
@@ -11,7 +11,7 @@
  bison (>= 1:2.1),
  flex,
  libfl-dev,
- python
+ python3
 Standards-Version: 4.1.4
 Homepage: http://faumachine.potyra.de/
 
diff -Nru fauhdlc-20180504/debian/patches/0002-update-python.patch 
fauhdlc-20180504/debian/patches/0002-update-python.patch
--- fauhdlc-20180504/debian/patches/0002-update-python.patch    1970-01-01 
01:00:00.000000000 +0100
+++ fauhdlc-20180504/debian/patches/0002-update-python.patch    2019-12-04 
20:21:21.000000000 +0100
@@ -0,0 +1,137 @@
+Description: Update interpreter of testsuite to python3
+ Update calls to print to python3.
+ Change calls to file() to open().
+Author: Stefan Potyra <ste...@potyra.de>
+Forwarded: no
+
+Index: fauhdlc-20180504/tests/run-tests.py
+===================================================================
+--- fauhdlc-20180504.orig/tests/run-tests.py
++++ fauhdlc-20180504/tests/run-tests.py
+@@ -1,9 +1,4 @@
+-#!/bin/sh
+-# vim: set filetype=python :
+-''''which python2   >/dev/null 2>&1 && exec python2   "$0" "$@" # '''
+-''''which python2.7 >/dev/null 2>&1 && exec python2.7 "$0" "$@" # '''
+-''''which python    >/dev/null 2>&1 && exec python    "$0" "$@" # '''
+-''''exec echo "Error: I can't find python anywhere"             # '''
++#!/usr/bin/python3
+ 
+ # Run the test suite.
+ #
+@@ -39,7 +34,7 @@ class file_handling:
+       def get_output_name(cls, filename, prefix="."):
+               dir = "%s/%s" % (cls._builddir, prefix)
+               if not os.path.isdir(dir):
+-                      print "Creating directory %s" % dir
++                      print("Creating directory %s" % dir)
+                       os.mkdir(dir)
+               return "%s/%s" % (dir, filename)
+ 
+@@ -101,8 +96,8 @@ class InterpreteTC:
+               return cls.useValgrind
+ 
+       def execute(self):
+-              fout = file(self._get_file_name("std.out"), "w")
+-              ferr = file(self._get_file_name("err.out"), "w")
++              fout = open(self._get_file_name("std.out"), "w")
++              ferr = open(self._get_file_name("err.out"), "w")
+ 
+               if InterpreteTC.canUseValgrind():
+                       # Use the next lines for deep memory debugging.
+@@ -131,13 +126,13 @@ class InterpreteTC:
+               ferr.close()
+ 
+       def _handle_err_out(self):
+-              ferr = file(self._get_file_name("err.out"), "r")
+-              fout = file(self._get_file_name("std.out"), "r")
++              ferr = open(self._get_file_name("err.out"), "r")
++              fout = open(self._get_file_name("std.out"), "r")
+               lines = ferr.readlines()
+               ferr.close()
+               if InterpreteTC.canUseValgrind():
+                       # write valgrind info to separate file
+-                      vout = file(self._get_file_name("valgrind.err.out"), 
"w")
++                      vout = open(self._get_file_name("valgrind.err.out"), 
"w")
+                       vout.writelines(lines)
+                       vout.close()
+               sim_fin_seen = False
+@@ -240,7 +235,7 @@ class TestCase:
+               d = eval_helper.eval_opt_list(arr[0])
+ 
+               opts = []
+-              if d.has_key("OPTS"):
++              if "OPTS" in d:
+                       opts += d["OPTS"].split(" ")
+ 
+               for o in opts:
+@@ -262,8 +257,8 @@ class TestCase:
+ 
+       def execute(self, compiler, common_opts, output_ic=False):
+               """ execute the test """
+-              fout = file(self._get_out_file_name("std.out"), "w")
+-              ferr = file(self._get_out_file_name("err.out"), "w")
++              fout = open(self._get_out_file_name("std.out"), "w")
++              ferr = open(self._get_out_file_name("err.out"), "w")
+ 
+               cmd = [compiler]
+               if len(common_opts) > 0:
+@@ -285,7 +280,7 @@ class TestCase:
+               ferr.close()
+ 
+       def _store_err_out(self):
+-              f = file(self._get_out_file_name("err.out"), "r")
++              f = open(self._get_out_file_name("err.out"), "r")
+               self._err_out = f.readlines()
+               f.close()
+ 
+@@ -329,7 +324,7 @@ class TestCase:
+ 
+       def _check_vhdl(self):
+               lno = 0
+-              f = file(self._get_src_file_name("vhdl"), "r")
++              f = open(self._get_src_file_name("vhdl"), "r")
+               errs = []
+ 
+               for l in f.readlines():
+@@ -449,7 +444,7 @@ class TestSuite:
+       
+       def parse(self):
+               f = None
+-              f = file(self._listfile, "r")
++              f = open(self._listfile, "r")
+ 
+               lines = f.readlines()
+               f.close()
+@@ -467,13 +462,13 @@ class TestSuite:
+               self._common_opts = ""
+               self._output_ic = False
+ 
+-              if opts.has_key("DESC"):
++              if "DESC" in opts:
+                       self._description = opts["DESC"]
+ 
+-              if opts.has_key("COMMON_OPTS"):
++              if "COMMON_OPTS" in opts:
+                       self._common_opts = opts["COMMON_OPTS"]
+ 
+-              if opts.has_key("OUTPUT"):
++              if "OUTPUT" in opts:
+                       if opts["OUTPUT"] == 'True':
+                               self._output_ic = True
+ 
+@@ -481,7 +476,7 @@ class TestSuite:
+               d = eval_helper.eval_opt_list(s)
+               tc = None
+ 
+-              if d.has_key("QUIET") and (d["QUIET"] == "True"):
++              if ("QUIET" in d) and (d["QUIET"] == "True"):
+                       tc = QuietTestCase(s, self._subdir)
+               else:
+                       tc = TestCase(s, self._subdir)
+@@ -575,4 +570,4 @@ if __name__ == "__main__":
+                       "error_tests")
+       alltest = AllTest(suites)
+       alltest.execute()
+-      print "\n" + str(alltest)
++      print("\n" + str(alltest))
diff -Nru fauhdlc-20180504/debian/patches/series 
fauhdlc-20180504/debian/patches/series
--- fauhdlc-20180504/debian/patches/series      2019-03-09 23:58:44.000000000 
+0100
+++ fauhdlc-20180504/debian/patches/series      2019-12-04 20:21:21.000000000 
+0100
@@ -1 +1,2 @@
 0001-Fix-FTBFS.patch
+0002-update-python.patch

Attachment: signature.asc
Description: PGP signature

Reply via email to