Skip to content

Commit

Permalink
#3978 exit code is an int
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Sep 25, 2023
1 parent 2081853 commit c985654
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions xpra/scripts/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,7 @@ def socket_details(state=DotXpra.LIVE):
nomatch=f"cannot find live server for display {display}")[-1]
return sockpath

def run_client(script_file, cmdline, error_cb, opts, extra_args, mode:str) -> int:
def run_client(script_file, cmdline, error_cb, opts, extra_args, mode:str) -> int | ExitCode:
if mode=="attach":
check_gtk_client()
else:
Expand All @@ -1285,7 +1285,7 @@ def run_client(script_file, cmdline, error_cb, opts, extra_args, mode:str) -> in
displays = dotxpra.displays(check_uid=getuid(), matching_state=DotXpra.LIVE)
if not displays:
sys.stdout.write("No xpra sessions found\n")
return 1
return ExitCode.FILE_NOT_FOUND
#we have to locate the 'all' command line argument,
#so we can replace it with each display we find,
#but some other command line arguments can take a value of 'all',
Expand All @@ -1306,7 +1306,7 @@ def run_client(script_file, cmdline, error_cb, opts, extra_args, mode:str) -> in
for display in displays:
dcmd = cmd + [display] + ["--splash=no"]
Popen(dcmd, stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=not WIN32)
return 0
return ExitCode.OK
app = get_client_app(cmdline, error_cb, opts, extra_args, mode)
r = do_run_client(app)
if opts.reconnect is not False and r in RETRY_EXIT_CODES:
Expand Down Expand Up @@ -1815,7 +1815,7 @@ def impcheck(*modules):
return app


def do_run_client(app) -> int:
def do_run_client(app) -> int | ExitCode:
try:
return app.run()
except KeyboardInterrupt:
Expand Down

0 comments on commit c985654

Please sign in to comment.