chiark / gitweb /
Fix the mac build.
authordaid <daid303@gmail.com>
Fri, 22 Nov 2013 14:23:20 +0000 (15:23 +0100)
committerdaid <daid303@gmail.com>
Fri, 22 Nov 2013 14:23:20 +0000 (15:23 +0100)
Cura/util/version.py

index 051f241447bc443d7e94e691af51b920f14296f3..023649ff2b3b35f6ae53acabf700bb27fcbb1e7f 100644 (file)
@@ -21,11 +21,14 @@ def getVersion(getGitVersion = True):
                versionFile = os.path.abspath(os.path.join(os.path.split(os.path.abspath(__file__))[0], "../version"))
 
        if getGitVersion:
-               gitProcess = subprocess.Popen(args = "git show -s --pretty=format:%H", shell = True, cwd = gitPath, stdout = subprocess.PIPE, stderr = subprocess.PIPE)
-               (stdoutdata, stderrdata) = gitProcess.communicate()
+               try:
+                       gitProcess = subprocess.Popen(args = "git show -s --pretty=format:%H", shell = True, cwd = gitPath, stdout = subprocess.PIPE, stderr = subprocess.PIPE)
+                       (stdoutdata, stderrdata) = gitProcess.communicate()
 
-               if gitProcess.returncode == 0:
-                       return stdoutdata
+                       if gitProcess.returncode == 0:
+                               return stdoutdata
+               except:
+                       pass
 
        gitHeadFile = gitPath + "/.git/refs/heads/SteamEngine"
        if os.path.isfile(gitHeadFile):