diff options
| author | Bruno Haible <bruno@clisp.org> | 2022-01-02 15:39:59 +0100 |
|---|---|---|
| committer | Bruno Haible <bruno@clisp.org> | 2022-01-02 15:39:59 +0100 |
| commit | d7fb221d293ad95130d2a8d5177639eed298b9c8 (patch) | |
| tree | 1352df3a216d46b754c2f17c10d88619a1fa78ab /gettext-tools/tests | |
| parent | d452d71e630b59025f4107c0d1a5cbca8483c6b1 (diff) | |
| download | gettext-d7fb221d293ad95130d2a8d5177639eed298b9c8.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.
Diffstat (limited to 'gettext-tools/tests')
| -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 |
