kuuko pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=4a337ccc10559ebc694ad65b30579b2cb2a5fccd

commit 4a337ccc10559ebc694ad65b30579b2cb2a5fccd
Author: Kai Huuhko <[email protected]>
Date:   Mon Aug 18 07:58:36 2014 +0300

    setup.py: Add dummy commit count for dev build if git is not found
---
 setup.py | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/setup.py b/setup.py
index c3e5ce0..864ce8a 100755
--- a/setup.py
+++ b/setup.py
@@ -23,15 +23,20 @@ ELM_MIN_VERSION = RELEASE
 
 
 # Add git commit count for dev builds
-if vers[2] >= 99:
-    call = subprocess.Popen(
-        ["git", "log", "--oneline"], stdout=subprocess.PIPE)
-    out, err = call.communicate()
-    log = out.decode("utf-8").strip()
-    if log:
-        ver = log.count("\n")
-        RELEASE += "a" + str(ver)
-
+if vers[2] == 99:
+    try:
+        call = subprocess.Popen(
+            ["git", "log", "--oneline"], stdout=subprocess.PIPE)
+        out, err = call.communicate()
+    except Exception:
+        RELEASE += "a0"
+    else:
+        log = out.decode("utf-8").strip()
+        if log:
+            ver = log.count("\n")
+            RELEASE += "a" + str(ver)
+        else:
+            RELEASE += "a0"
 
 # XXX: Force default visibility. See phab T504
 if os.getenv("CFLAGS") is not None and "-fvisibility=" in os.environ["CFLAGS"]:

-- 


Reply via email to