Skip to content

Commit 0f82f69

Browse files
committed
Suppress prompt spawned by subprocess when using pythonw
1 parent 19fa43f commit 0f82f69

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

sentry_sdk/utils.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import linecache
33
import logging
44
import os
5+
import platform
56
import sys
67
import threading
78
import subprocess
@@ -60,11 +61,17 @@ def get_default_release():
6061
if release:
6162
return release
6263

64+
startupinfo = None
65+
if platform.system() == "Windows":
66+
startupinfo = subprocess.STARTUPINFO()
67+
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
68+
6369
with open(os.path.devnull, "w+") as null:
6470
try:
6571
release = (
6672
subprocess.Popen(
6773
["git", "rev-parse", "HEAD"],
74+
startupinfo=startupinfo,
6875
stdout=subprocess.PIPE,
6976
stderr=null,
7077
stdin=null,

0 commit comments

Comments
 (0)