summary refs log tree commit diff
path: root/synapse/util/versionstring.py
diff options
context:
space:
mode:
authorHubert Chathi <hubert@uhoreg.ca>2019-10-30 10:17:10 -0400
committerHubert Chathi <hubert@uhoreg.ca>2019-10-30 10:17:10 -0400
commit7d7eac61be337b7a3ed7274a13e131f41d0966d9 (patch)
treee6f70c499902b00ed0450e24bb4132e3079698e6 /synapse/util/versionstring.py
parentblack (diff)
parentMerge pull request #6240 from matrix-org/erikj/split_out_persistence_store (diff)
downloadsynapse-7d7eac61be337b7a3ed7274a13e131f41d0966d9.tar.xz
Merge branch 'develop' into cross-signing_federation
Diffstat (limited to 'synapse/util/versionstring.py')
-rw-r--r--synapse/util/versionstring.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/synapse/util/versionstring.py b/synapse/util/versionstring.py
index fa404b9d75..ab7d03af3a 100644
--- a/synapse/util/versionstring.py
+++ b/synapse/util/versionstring.py
@@ -42,6 +42,7 @@ def get_version_string(module):
     try:
         null = open(os.devnull, "w")
         cwd = os.path.dirname(os.path.abspath(module.__file__))
+
         try:
             git_branch = (
                 subprocess.check_output(
@@ -51,7 +52,8 @@ def get_version_string(module):
                 .decode("ascii")
             )
             git_branch = "b=" + git_branch
-        except subprocess.CalledProcessError:
+        except (subprocess.CalledProcessError, FileNotFoundError):
+            # FileNotFoundError can arise when git is not installed
             git_branch = ""
 
         try:
@@ -63,7 +65,7 @@ def get_version_string(module):
                 .decode("ascii")
             )
             git_tag = "t=" + git_tag
-        except subprocess.CalledProcessError:
+        except (subprocess.CalledProcessError, FileNotFoundError):
             git_tag = ""
 
         try:
@@ -74,7 +76,7 @@ def get_version_string(module):
                 .strip()
                 .decode("ascii")
             )
-        except subprocess.CalledProcessError:
+        except (subprocess.CalledProcessError, FileNotFoundError):
             git_commit = ""
 
         try:
@@ -89,7 +91,7 @@ def get_version_string(module):
             )
 
             git_dirty = "dirty" if is_dirty else ""
-        except subprocess.CalledProcessError:
+        except (subprocess.CalledProcessError, FileNotFoundError):
             git_dirty = ""
 
         if git_branch or git_tag or git_commit or git_dirty: