1
0
forked from mirrors/0ad
Files
0ad/libraries/source/cxxtest-4.4/patches/0001-Add-Debian-python3-patch.patch
Ralph Sennhauser 3ba61ed39e Improve cxxtest python compatibility
Use patch by Debian [1] replacing python in shebang with python3 and fixing
some warnings with recent python versions.

The reason being some use an alias of python for python3 instead of the
customary symlink. Aliases are only expanded in interactive shells
unless expansion is explicitly enabled.

[1] https://sources.debian.org/patches/cxxtest/4.4%2Bgit171022-2/python3.patch/

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2024-11-03 07:10:06 +01:00

67 lines
2.1 KiB
Diff

From 7a2a0a412247469ea20fd7f98941c286355bf969 Mon Sep 17 00:00:00 2001
From: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Date: Fri, 1 Nov 2024 19:42:39 +0100
Subject: [PATCH] Add Debian python3 patch
Uses python3 instead python and fixes warnings with recent python.
This patch is taken from Debian
https://sources.debian.org/patches/cxxtest/4.4%2Bgit171022-2/python3.patch/
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
---
bin/cxxtestgen | 2 +-
doc/include_anchors.py | 10 +++++-----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/bin/cxxtestgen b/bin/cxxtestgen
index e001cfa..c71f8e5 100755
--- a/bin/cxxtestgen
+++ b/bin/cxxtestgen
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
#
# The CxxTest driver script, which uses the cxxtest Python package.
#
diff --git a/doc/include_anchors.py b/doc/include_anchors.py
index 8279cad..8dd661f 100644
--- a/doc/include_anchors.py
+++ b/doc/include_anchors.py
@@ -44,18 +44,18 @@ def process(dir, root, suffix):
del anchors[anchor]
else:
for anchor in anchors:
- os.write(anchors[anchor].fileno(), line)
+ os.write(anchors[anchor].fileno(), line.encode())
INPUT.close()
for anchor in anchors:
if anchor != '':
- print "ERROR: anchor '%s' did not terminate" % anchor
+ print("ERROR: anchor '%s' did not terminate" % anchor)
anchors[anchor].close()
#
processed.add(bname)
for file in sys.argv[1:]:
- print "Processing file '%s' ..." % file
+ print("Processing file '%s' ..." % file)
INPUT = open(file, 'r')
for line in INPUT:
suffix = None
@@ -82,8 +82,8 @@ for file in sys.argv[1:]:
#print "HERE", line, suffix
fname = m.group(1)+m.group(2)+'.'+suffix
if not os.path.exists(fname):
- print line
- print "ERROR: file '%s' does not exist!" % fname
+ print(line)
+ print("ERROR: file '%s' does not exist!" % fname)
sys.exit(1)
process(m.group(1), m.group(2), suffix)
INPUT.close()
--
2.45.2