|
7 | 7 | from typing import Dict, Any, List, Set, Union, Tuple
|
8 | 8 | from umu_plugins import enable_steam_game_drive, set_env_toml, enable_reaper
|
9 | 9 | from re import match
|
10 |
| -from subprocess import run, CalledProcessError |
| 10 | +from subprocess import run |
11 | 11 | from umu_dl_util import get_umu_proton
|
12 | 12 | from umu_consts import PROTON_VERBS, DEBUG_FORMAT, STEAM_COMPAT, UMU_LOCAL
|
13 | 13 | from umu_util import setup_umu
|
@@ -255,7 +255,7 @@ def build_command(
|
255 | 255 | return command
|
256 | 256 |
|
257 | 257 |
|
258 |
| -def main() -> None: # noqa: D103 |
| 258 | +def main() -> int: # noqa: D103 |
259 | 259 | env: Dict[str, str] = {
|
260 | 260 | "WINEPREFIX": "",
|
261 | 261 | "GAMEID": "",
|
@@ -350,17 +350,18 @@ def main() -> None: # noqa: D103
|
350 | 350 | build_command(env, UMU_LOCAL, command, opts)
|
351 | 351 | log.debug("%s", command)
|
352 | 352 |
|
353 |
| - return run(command, check=True) |
| 353 | + return run(command, check=False).returncode |
354 | 354 |
|
355 | 355 |
|
356 | 356 | if __name__ == "__main__":
|
357 | 357 | try:
|
358 |
| - main() |
| 358 | + sys.exit(main()) |
359 | 359 | except KeyboardInterrupt:
|
360 | 360 | log.warning("Keyboard Interrupt")
|
361 | 361 | sys.exit(1)
|
362 |
| - except CalledProcessError: |
363 |
| - log.exception("CalledProcessError") |
| 362 | + except SystemExit as e: |
| 363 | + if e.code != 0: |
| 364 | + raise Exception(e) |
364 | 365 | except Exception:
|
365 | 366 | log.exception("Exception")
|
366 | 367 | sys.exit(1)
|
|
0 commit comments