add indicator to debug output when using a standalone executable
This commit is contained in:
parent
64978b5d37
commit
45ca1693d8
@ -142,20 +142,23 @@ def main():
|
||||
import os.path
|
||||
import requests
|
||||
|
||||
head = ""
|
||||
try:
|
||||
out, err = subprocess.Popen(
|
||||
("git", "rev-parse", "--short", "HEAD"),
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
cwd=os.path.dirname(os.path.abspath(__file__)),
|
||||
).communicate()
|
||||
if out and not err:
|
||||
head = " - Git HEAD: " + out.decode().rstrip()
|
||||
except (OSError, subprocess.SubprocessError):
|
||||
pass
|
||||
extra = ""
|
||||
if getattr(sys, "frozen", False):
|
||||
extra = " - Executable"
|
||||
else:
|
||||
try:
|
||||
out, err = subprocess.Popen(
|
||||
("git", "rev-parse", "--short", "HEAD"),
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
cwd=os.path.dirname(os.path.abspath(__file__)),
|
||||
).communicate()
|
||||
if out and not err:
|
||||
extra = " - Git HEAD: " + out.decode().rstrip()
|
||||
except (OSError, subprocess.SubprocessError):
|
||||
pass
|
||||
|
||||
log.debug("Version %s%s", __version__, head)
|
||||
log.debug("Version %s%s", __version__, extra)
|
||||
log.debug("Python %s - %s",
|
||||
platform.python_version(), platform.platform())
|
||||
try:
|
||||
|
Loading…
x
Reference in New Issue
Block a user