mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 02:14:49 -04:00
Port over enough to get some sytests running on Python 3 (#3668)
This commit is contained in:
parent
cf6f9a8b53
commit
324525f40c
12 changed files with 91 additions and 40 deletions
|
@ -30,7 +30,7 @@ def get_version_string(module):
|
|||
['git', 'rev-parse', '--abbrev-ref', 'HEAD'],
|
||||
stderr=null,
|
||||
cwd=cwd,
|
||||
).strip()
|
||||
).strip().decode('ascii')
|
||||
git_branch = "b=" + git_branch
|
||||
except subprocess.CalledProcessError:
|
||||
git_branch = ""
|
||||
|
@ -40,7 +40,7 @@ def get_version_string(module):
|
|||
['git', 'describe', '--exact-match'],
|
||||
stderr=null,
|
||||
cwd=cwd,
|
||||
).strip()
|
||||
).strip().decode('ascii')
|
||||
git_tag = "t=" + git_tag
|
||||
except subprocess.CalledProcessError:
|
||||
git_tag = ""
|
||||
|
@ -50,7 +50,7 @@ def get_version_string(module):
|
|||
['git', 'rev-parse', '--short', 'HEAD'],
|
||||
stderr=null,
|
||||
cwd=cwd,
|
||||
).strip()
|
||||
).strip().decode('ascii')
|
||||
except subprocess.CalledProcessError:
|
||||
git_commit = ""
|
||||
|
||||
|
@ -60,7 +60,7 @@ def get_version_string(module):
|
|||
['git', 'describe', '--dirty=' + dirty_string],
|
||||
stderr=null,
|
||||
cwd=cwd,
|
||||
).strip().endswith(dirty_string)
|
||||
).strip().decode('ascii').endswith(dirty_string)
|
||||
|
||||
git_dirty = "dirty" if is_dirty else ""
|
||||
except subprocess.CalledProcessError:
|
||||
|
@ -77,8 +77,8 @@ def get_version_string(module):
|
|||
"%s (%s)" % (
|
||||
module.__version__, git_version,
|
||||
)
|
||||
).encode("ascii")
|
||||
)
|
||||
except Exception as e:
|
||||
logger.info("Failed to check for git repository: %s", e)
|
||||
|
||||
return module.__version__.encode("ascii")
|
||||
return module.__version__
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue