Skip to content

Commit 03c7719

Browse files
committed
mutex check simplify
1 parent db4cebe commit 03c7719

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

windows.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -383,14 +383,9 @@ def run_tray() -> None:
383383

384384

385385
def main() -> None:
386-
if mutex_result := _acquire_win_mutex() is False:
386+
if (mutex_result := _acquire_win_mutex()) is False or mutex_result is None and not acquire_lock():
387387
_show_info("Приложение уже запущено.", os.path.basename(sys.argv[0]))
388388
return
389-
if mutex_result is None:
390-
log.warning("Named mutex unavailable, falling back to lock file")
391-
if not acquire_lock():
392-
_show_info("Приложение уже запущено.", os.path.basename(sys.argv[0]))
393-
return
394389

395390
try:
396391
run_tray()

0 commit comments

Comments
 (0)