mirror of
https://github.com/MinaSaad1/pbi-cli
synced 2026-04-21 13:37:19 +00:00
fix: use subprocess instead of os.startfile for cross-platform mypy compat
This commit is contained in:
parent
5acb3f33e3
commit
22f75b1699
1 changed files with 5 additions and 2 deletions
|
|
@ -19,7 +19,6 @@ Requires pywin32.
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
|
@ -301,7 +300,11 @@ def _accept_save_dialog() -> None:
|
|||
def _reopen_pbip(pbip_path: str) -> dict[str, Any]:
|
||||
"""Launch the .pbip file with the system default handler."""
|
||||
try:
|
||||
os.startfile(pbip_path) # noqa: S606 # Windows-only API
|
||||
subprocess.Popen( # noqa: S603
|
||||
["cmd", "/c", "start", "", pbip_path],
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL,
|
||||
)
|
||||
return {
|
||||
"status": "success",
|
||||
"method": "pywin32",
|
||||
|
|
|
|||
Loading…
Reference in a new issue