[gimp] build: do not use os.EX_* exit code for cross-compatibility.



commit 3aa9c0b1612adac8aacab705d7042faee0ed246c
Author: Jehan <jehan girinstud io>
Date:   Sun Oct 10 13:47:15 2021 +0200

    build: do not use os.EX_* exit code for cross-compatibility.
    
    All the os.EX_* constants are Unix-only (and possibly not even not on
    all Unix/Linux-like platforms, according to docs) so we should not use
    them, especially for a script which we may use on Windows (we also run
    it when cross-compiling from Linux, but natively on Windows as well).
    
    Fixes this exception (which would only happen when there is another
    critical issue anyway, so it's not making a bigger problem; yet it's
    better to cleanly exit with an error code rather than by an exception):
    
    >   File "C:\_r\_builds\k3_3muaB\0\GNOME\gimp\build\windows\gitlab-ci\dll_link.py", line 124, in copy_dlls
        sys.exit(os.EX_DATAERR)
    > AttributeError: module 'os' has no attribute 'EX_DATAERR'

 build/windows/gitlab-ci/dll_link.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/build/windows/gitlab-ci/dll_link.py b/build/windows/gitlab-ci/dll_link.py
index 1280999a44..ea3bcf9f38 100755
--- a/build/windows/gitlab-ci/dll_link.py
+++ b/build/windows/gitlab-ci/dll_link.py
@@ -88,14 +88,14 @@ def find_dependencies(obj, srcdirs):
 
     if objdump is None:
       sys.stderr.write('File type of {} unknown: {}\n'.format(obj, file_type))
-      sys.exit(os.EX_UNAVAILABLE)
+      sys.exit(1)
     elif shutil.which(objdump) is None:
       # For native objdump case.
       objdump = 'objdump.exe'
 
     if shutil.which(objdump) is None:
       sys.stderr.write("Executable doesn't exist: {}\n".format(objdump))
-      sys.exit(os.EX_UNAVAILABLE)
+      sys.exit(1)
 
     result = subprocess.run([objdump, '-p', obj], stdout=subprocess.PIPE)
     out = result.stdout.decode('utf-8')
@@ -127,7 +127,7 @@ def copy_dlls(dll_list, srcdirs, destdir):
         # This should not happen. We determined that the dll is in one
         # of the srcdirs.
         sys.stderr.write("Missing DLL: {}\n".format(dll))
-        sys.exit(os.EX_DATAERR)
+        sys.exit(1)
 
 if __name__ == "__main__":
   parser = argparse.ArgumentParser()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]