diff options
Diffstat (limited to 'patches/cpp-docopt-python3-support-for-tests.patch')
| -rw-r--r-- | patches/cpp-docopt-python3-support-for-tests.patch | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/patches/cpp-docopt-python3-support-for-tests.patch b/patches/cpp-docopt-python3-support-for-tests.patch new file mode 100644 index 0000000..614d6d0 --- /dev/null +++ b/patches/cpp-docopt-python3-support-for-tests.patch | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | From 400e6dd8e59196c914dcc2c56caf7dae7efa5eb3 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Petr Mensik <pemensik@redhat.com> | ||
| 3 | Date: Fri, 12 Nov 2021 14:05:32 +0100 | ||
| 4 | Subject: [PATCH] Support python3 for running tests | ||
| 5 | |||
| 6 | Simple change done by 2to3 python tool. Make prints compatible with both | ||
| 7 | python3 and python2. | ||
| 8 | |||
| 9 | Change default version to python3. Still can be run by python2 | ||
| 10 | run_tests.py. | ||
| 11 | |||
| 12 | Signed-off-by: Petr Mensik <pemensik@redhat.com> | ||
| 13 | --- | ||
| 14 | run_tests.py | 20 ++++++++++---------- | ||
| 15 | 1 file changed, 10 insertions(+), 10 deletions(-) | ||
| 16 | |||
| 17 | diff --git a/run_tests.py b/run_tests.py | ||
| 18 | index ef723b4..b75e176 100755 | ||
| 19 | --- a/run_tests.py | ||
| 20 | +++ b/run_tests.py | ||
| 21 | @@ -1,4 +1,4 @@ | ||
| 22 | -#!/usr/bin/env python2 | ||
| 23 | +#!/usr/bin/env python3 | ||
| 24 | |||
| 25 | import re | ||
| 26 | import sys | ||
| 27 | @@ -56,17 +56,17 @@ def parse_test(raw): | ||
| 28 | |||
| 29 | failures += 1 | ||
| 30 | |||
| 31 | - print "="*40 | ||
| 32 | - print doc | ||
| 33 | - print ':'*20 | ||
| 34 | - print prog, argv | ||
| 35 | - print '-'*20 | ||
| 36 | + print("="*40) | ||
| 37 | + print(doc) | ||
| 38 | + print(':'*20) | ||
| 39 | + print(prog, argv) | ||
| 40 | + print('-'*20) | ||
| 41 | if out: | ||
| 42 | - print out | ||
| 43 | - print error | ||
| 44 | + print(out) | ||
| 45 | + print(error) | ||
| 46 | |||
| 47 | if failures: | ||
| 48 | - print "%d failures" % failures | ||
| 49 | + print("%d failures" % failures) | ||
| 50 | sys.exit(1) | ||
| 51 | else: | ||
| 52 | - print "PASS (%d)" % passes | ||
| 53 | + print("PASS (%d)" % passes) | ||
