]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool.py: Fix an exception message.
authorBruno Haible <bruno@clisp.org>
Sun, 28 Jul 2024 21:38:45 +0000 (23:38 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 12 Aug 2024 16:06:14 +0000 (18:06 +0200)
* pygnulib/GLModuleSystem.py (GLModuleSystem.find): Raise error 23,
not 3.
* pygnulib/GLError.py: Provide an error message for error 23.
* pygnulib/main.py: Likewise.

ChangeLog
pygnulib/GLError.py
pygnulib/GLModuleSystem.py
pygnulib/main.py

index e27fb1f605cce31275503e0bd33e68f6271095ae..6bac9a4a8e30a9b1c0dd81dcffcbdeff1d9f94d9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-07-28  Bruno Haible  <bruno@clisp.org>
+
+       gnulib-tool.py: Fix an exception message.
+       * pygnulib/GLModuleSystem.py (GLModuleSystem.find): Raise error 23,
+       not 3.
+       * pygnulib/GLError.py: Provide an error message for error 23.
+       * pygnulib/main.py: Likewise.
+
 2024-07-26  Collin Funk  <collin.funk1@gmail.com>
 
        sys_time, sys_types: Remove sys directory at 'make mostlyclean'.
index a6d7d8437dca28e6463f36f42479384590ea4333..15e24a8bf21ae0e6488950fd9732786833ca097e 100644 (file)
@@ -56,6 +56,7 @@ class GLError(Exception):
          20: could not patch test-driver script
          21: Option --automake-subdir is only supported if the definition of AUTOMAKE_OPTIONS in Makefile.am contains 'subdir-objects'.
          22: not overwriting destination directory: <directory>
+         23: module <module> doesn't exist
         errinfo: additional information'''
         self.errno = errno
         self.errinfo = errinfo
@@ -110,5 +111,7 @@ class GLError(Exception):
                            'Makefile.am contains \'subdir-objects\'.')
             elif errno == 22:
                 message = 'not overwriting destination directory: %s' % repr(errinfo)
+            elif errno == 23:
+                message = "module %s doesn't exist" % repr(errinfo)
             self.message = '[Errno %d] %s' % (errno, message)
         return self.message
index 02dacfcf9fd56a65bd83f48e8807f96b7666ee0d..0eb875a499231d0587ec5801dcb5599f6db2a561 100644 (file)
@@ -113,7 +113,7 @@ class GLModuleSystem:
             return result
         else:  # if not self.exists(module)
             if self.config['errors']:
-                raise GLError(3, module_name)
+                raise GLError(23, module_name)
             else:  # if not self.config['errors']
                 sys.stderr.write('gnulib-tool: warning: ')
                 sys.stderr.write("module %s doesn't exist\n" % module_name)
index c1c2cd2c1e6e41b4bb836a759b7613d78e3e14ad..9767f386763b821fba2a05ffe216bb98cbaa25db 100644 (file)
@@ -1457,6 +1457,8 @@ def main_with_exception_handling() -> None:
                             'Makefile.am contains \'subdir-objects\'.')
             elif errno == 22:
                 message += 'not overwriting destination directory: %s' % errinfo
+            elif errno == 23:
+                message += "module %s doesn't exist" % errinfo
             message += '\n%s: *** Stop.\n' % APP['name']
             sys.stderr.write(message)
             sys.exit(1)