Commit b7e05685 authored by Lorenz Huedepohl's avatar Lorenz Huedepohl
Browse files

Support Python 2 for a bit more

But the end is coming!
parent d5f0620d
Pipeline #67009 failed with stage
in 15 seconds
......@@ -58,14 +58,19 @@ def check_for_update():
else:
setattr(sys.modules["mpcdf_common"], "checked_for_updates", 1)
if (sys.version_info > (3, 0)):
set_encoding = {"encoding" : "utf-8"}
else:
set_encoding = {}
plugin_dir = os.path.dirname(os.path.realpath(__file__))
git_dir = os.path.join(plugin_dir, ".git")
local_rev = check_output(["git", "--git-dir", git_dir, "rev-parse", "HEAD"], encoding="utf-8").strip()
local_rev = check_output(["git", "--git-dir", git_dir, "rev-parse", "HEAD"], **set_encoding).strip()
url = "https://gitlab.mpcdf.mpg.de/mpcdf/osc-plugins.git"
def update_server_rev():
server_rev, _ = check_output(["git", "ls-remote", url, "master"], encoding="utf-8").split(maxsplit=1)
server_rev, _ = check_output(["git", "ls-remote", url, "master"], **set_encoding).split(maxsplit=1)
with open(rev_file, "w") as fd:
fd.write(server_rev)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment