diff options
author | Bruno Haible <bruno@clisp.org> | 2022-01-02 15:39:59 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2022-10-09 09:30:42 +0200 |
commit | 42bb27463127242c9adea99b2dd47a0e8c958478 (patch) | |
tree | b78591cdcac13be81ca2b657f7988e5501e2e178 | |
parent | e237072fc2176567f37f7f8c05b523453262eb35 (diff) | |
download | gettext-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-x | gettext-tools/tests/lang-python-1 | 8 | ||||
-rwxr-xr-x | gettext-tools/tests/lang-python-2 | 12 |
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 |