Skip to content

Commit 512ae20

Browse files
authored
Fix dmypy for older Pythons on Windows (#6053)
STARTUPINFO does not have a custom __init__ in Python < 3.7. So instead of passing attributes to it, we set them after initialization. Fixes #6046.
1 parent b3a7f89 commit 512ae20

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mypy/dmypy_server.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ def daemonize(options: Options,
5858
command = [sys.executable, '-m', 'mypy.dmypy', '--status-file', status_file, 'daemon']
5959
pickeled_options = pickle.dumps((options.snapshot(), timeout, log_file))
6060
command.append('--options-data="{}"'.format(base64.b64encode(pickeled_options).decode()))
61-
info = STARTUPINFO(dwFlags=0x1, # STARTF_USESHOWWINDOW aka use wShowWindow's value
62-
wShowWindow=0, # SW_HIDE aka make the window invisible
63-
)
61+
info = STARTUPINFO()
62+
info.dwFlags = 0x1 # STARTF_USESHOWWINDOW aka use wShowWindow's value
63+
info.wShowWindow = 0 # SW_HIDE aka make the window invisible
6464
try:
6565
subprocess.Popen(command,
6666
creationflags=0x10, # CREATE_NEW_CONSOLE

0 commit comments

Comments
 (0)