lima: Fix unused var/function warnings in release build from assertions.
[mesa.git] / bin / git_sha1_gen.py
index c6fbf4903020b1b1f292468f313a983c356ca340..a457b310d48085dcb9367df54bacc1974a064248 100644 (file)
@@ -1,9 +1,7 @@
 """
 Generate the contents of the git_sha1.h file.
-The output of this script goes to stdout.
 """
 
-
 import argparse
 import os
 import os.path
@@ -21,11 +19,12 @@ def get_git_sha1():
             'rev-parse',
             'HEAD',
         ], stderr=open(os.devnull, 'w')).decode("ascii")
-    except:
+    except Exception:
         # don't print anything if it fails
         git_sha1 = ''
     return git_sha1
 
+
 def write_if_different(contents):
     """
     Avoid touching the output file if it doesn't need modifications
@@ -38,6 +37,7 @@ def write_if_different(contents):
     with open(args.output, 'w') as file:
         file.write(contents)
 
+
 parser = argparse.ArgumentParser()
 parser.add_argument('--output', help='File to write the #define in',
                     required=True)