about summary refs log tree commit diff
path: root/.custom-format.py
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2019-12-03 01:40:41 +0100
committerGitHub <noreply@github.com>2019-12-03 01:40:41 +0100
commit4231c498392484fd2187b9ed1dedb1ba7bc0958b (patch)
tree366586c4ceef17998670a8c2d978869bdac64d56 /.custom-format.py
parentb0d590fef4acb4b002429e4aec195e5740122494 (diff)
parentef2dc98773c55eb09e4c1a588fb74df58570f868 (diff)
downloadafl++-4231c498392484fd2187b9ed1dedb1ba7bc0958b.tar.gz
Merge branch 'master' into llvm_mode_build_fix
Diffstat (limited to '.custom-format.py')
-rwxr-xr-x.custom-format.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/.custom-format.py b/.custom-format.py
index 8d762006..70107997 100755
--- a/.custom-format.py
+++ b/.custom-format.py
@@ -27,12 +27,15 @@ with open(".clang-format") as f:
 
 CLANG_FORMAT_BIN = os.getenv("CLANG_FORMAT_BIN")
 if CLANG_FORMAT_BIN is None:
-    p = subprocess.Popen(["clang-format", "--version"], stdout=subprocess.PIPE)
-    o, _ = p.communicate()
-    o = str(o, "utf-8")
-    o = o[len("clang-format version "):].strip()
-    o = o[:o.find(".")]
-    o = int(o)
+    o = 0
+    try:
+        p = subprocess.Popen(["clang-format", "--version"], stdout=subprocess.PIPE)
+        o, _ = p.communicate()
+        o = str(o, "utf-8")
+        o = o[len("clang-format version "):].strip()
+        o = o[:o.find(".")]
+        o = int(o)
+    except: pass
     if o < 7:
         if subprocess.call(['which', 'clang-format-7'], stdout=subprocess.PIPE) == 0:
             CLANG_FORMAT_BIN = 'clang-format-7'