]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Fix lang-python-* test failures with Python 3.8.
authorBruno Haible <bruno@clisp.org>
Sun, 2 Jan 2022 14:39:59 +0000 (15:39 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 9 Oct 2022 07:30:42 +0000 (09:30 +0200)
* gettext-tools/tests/lang-python-1: Use syntax that works also with Python 3.
* gettext-tools/tests/lang-python-2: Likewise.

gettext-tools/tests/lang-python-1
gettext-tools/tests/lang-python-2

index 4e5acd9cce78761248ccb5004fb7ed7ec15d5099..41264bfaa62f74ab5ffedd8e8cc18e5a6a874f4f 100755 (executable)
@@ -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
index c1af9275ad8e5f3d8f8af29e8d316a384b13d5e1..939400395abe95649ae3e4b49c74d73497eaaf58 100755 (executable)
@@ -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