Skip to content

Commit 4213cff

Browse files
committed
all os update
1 parent aae10b2 commit 4213cff

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/dbs_annotator/utils/auto_update.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import subprocess
99
import sys
1010
import tempfile
11+
import urllib.error
1112
import urllib.request
1213
from pathlib import Path
1314

@@ -19,6 +20,8 @@
1920

2021
_INSTALL_SCRIPT_BRANCH = "main"
2122
_USER_AGENT = "DBSAnnotator-AutoUpdate/1.0"
23+
# Windows-only; absent on Linux/macOS (CI runs unit tests there too).
24+
_WINDOWS_NEW_CONSOLE = getattr(subprocess, "CREATE_NEW_CONSOLE", 0)
2225

2326

2427
def _install_script_url(filename: str) -> str:
@@ -116,7 +119,7 @@ def _launch_windows(tag: str, *, dry_run: bool = False) -> tuple[bool, str]:
116119
cmd.append("-WhatIf")
117120
subprocess.Popen(
118121
cmd,
119-
creationflags=subprocess.CREATE_NEW_CONSOLE,
122+
creationflags=_WINDOWS_NEW_CONSOLE,
120123
close_fds=True,
121124
)
122125
finally:

0 commit comments

Comments
 (0)