Skip to content

Commit

Permalink
Suppress prompt spawned by subprocess when using pythonw
Browse files Browse the repository at this point in the history
  • Loading branch information
collinbanko committed Apr 9, 2021
1 parent 19fa43f commit d3e0b9f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sentry_sdk/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,17 @@ def get_default_release():
if release:
return release

startupinfo = None
if sys.platform == "win32" or sys.platform == "cygwin":
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW

with open(os.path.devnull, "w+") as null:
try:
release = (
subprocess.Popen(
["git", "rev-parse", "HEAD"],
startupinfo=startupinfo,
stdout=subprocess.PIPE,
stderr=null,
stdin=null,
Expand Down

0 comments on commit d3e0b9f

Please sign in to comment.