Running gnulib-tool.py with Python 3.10.4 produces this warning:

.../gnulib/pygnulib/GLModuleSystem.py:386: SyntaxWarning: 'str' object is not 
callable; perhaps you missed a comma?
  result = '%s_GNULIB_ENABLED_%s' (macro_prefix, name)

This patch fixes it.


2022-07-29  Bruno Haible  <br...@clisp.org>

        gnulib-tool.py: Fix warning from Python 3.10.4.
        * pygnulib/GLModuleSystem.py (getConditionalName): Fix a string
        substitution expression.

diff --git a/pygnulib/GLModuleSystem.py b/pygnulib/GLModuleSystem.py
index 73c207d995..11ff4c7963 100644
--- a/pygnulib/GLModuleSystem.py
+++ b/pygnulib/GLModuleSystem.py
@@ -383,7 +383,7 @@ Include:|Link:|License:|Maintainer:)'
             name = hashlib.md5(name).hexdigest()
             conditional = '%s_GNULIB_ENABLED_%s' % (macro_prefix, name)
         else:  # if not nonascii
-            result = '%s_GNULIB_ENABLED_%s' (macro_prefix, name)
+            result = '%s_GNULIB_ENABLED_%s' % (macro_prefix, name)
         if type(result) is bytes:
             result = result.decode(ENCS['default'])
         return(result)




Reply via email to