summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2022-01-02 15:39:59 +0100
committerBruno Haible <bruno@clisp.org>2022-10-09 09:30:42 +0200
commit42bb27463127242c9adea99b2dd47a0e8c958478 (patch)
treeb78591cdcac13be81ca2b657f7988e5501e2e178
parente237072fc2176567f37f7f8c05b523453262eb35 (diff)
downloadgettext-42bb27463127242c9adea99b2dd47a0e8c958478.tar.gz
Fix lang-python-* test failures with Python 3.8.
* gettext-tools/tests/lang-python-1: Use syntax that works also with Python 3. * gettext-tools/tests/lang-python-2: Likewise.
-rwxr-xr-xgettext-tools/tests/lang-python-18
-rwxr-xr-xgettext-tools/tests/lang-python-212
2 files changed, 10 insertions, 10 deletions
diff --git a/gettext-tools/tests/lang-python-1 b/gettext-tools/tests/lang-python-1
index 4e5acd9cc..41264bfaa 100755
--- a/gettext-tools/tests/lang-python-1
+++ b/gettext-tools/tests/lang-python-1
@@ -13,9 +13,9 @@ import gettext
gettext.textdomain('prog')
gettext.bindtextdomain('prog', '.')
-print gettext.gettext("'Your command, please?', asked the waiter.")
-print gettext.gettext("%(oldCurrency)s is replaced by %(newCurrency)s.") \
- % { 'oldCurrency': "FF", 'newCurrency' : "EUR" }
+print(gettext.gettext("'Your command, please?', asked the waiter."))
+print(gettext.gettext("%(oldCurrency)s is replaced by %(newCurrency)s.") \
+ % { 'oldCurrency': "FF", 'newCurrency' : "EUR" })
EOF
: ${XGETTEXT=xgettext}
@@ -65,7 +65,7 @@ ${MSGFMT} -o fr/LC_MESSAGES/prog.mo fr.po
# Test for presence of python version 2.0 or newer.
(python -V) >/dev/null 2>/dev/null \
|| { echo "Skipping test: python not found"; Exit 77; }
-case `python -c 'import sys; print sys.hexversion >= 0x20000F0'` in
+case `python -c 'import sys; print(sys.hexversion >= 0x20000F0)'` in
1 | True) ;;
*) echo "Skipping test: python version too old"; Exit 77;;
esac
diff --git a/gettext-tools/tests/lang-python-2 b/gettext-tools/tests/lang-python-2
index c1af9275a..939400395 100755
--- a/gettext-tools/tests/lang-python-2
+++ b/gettext-tools/tests/lang-python-2
@@ -17,11 +17,11 @@ n = int(sys.argv[1])
gettext.textdomain('prog')
gettext.bindtextdomain('prog', '.')
-print gettext.gettext("'Your command, please?', asked the waiter.")
-print gettext.ngettext("a piece of cake","%(count)d pieces of cake",n) \
- % { 'count': n }
-print gettext.gettext("%(oldCurrency)s is replaced by %(newCurrency)s.") \
- % { 'oldCurrency': "FF", 'newCurrency' : "EUR" }
+print(gettext.gettext("'Your command, please?', asked the waiter."))
+print(gettext.ngettext("a piece of cake","%(count)d pieces of cake",n) \
+ % { 'count': n })
+print(gettext.gettext("%(oldCurrency)s is replaced by %(newCurrency)s.") \
+ % { 'oldCurrency': "FF", 'newCurrency' : "EUR" })
EOF
: ${XGETTEXT=xgettext}
@@ -84,7 +84,7 @@ ${MSGFMT} -o fr/LC_MESSAGES/prog.mo fr.po
# Test for presence of python version 2.3 or newer.
(python -V) >/dev/null 2>/dev/null \
|| { echo "Skipping test: python not found"; Exit 77; }
-case `python -c 'import sys; print sys.hexversion >= 0x20300F0'` in
+case `python -c 'import sys; print(sys.hexversion >= 0x20300F0)'` in
1 | True) ;;
*) echo "Skipping test: python version too old"; Exit 77;;
esac