mirror of
https://github.com/borgbackup/borg.git
synced 2026-07-16 05:22:49 -04:00
process.py: guard signal.SIGALRM for Windows
signal.SIGALRM does not exist on Windows, so referencing it at module import time raised AttributeError, breaking the import chain (and the Windows PyInstaller build). Guard it with hasattr, matching the defensive getattr pattern already used for the notify signals. Daemonizing is not supported on Windows anyway (no os.fork), so the empty SIGALRM list has no functional effect there. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
d78c0f7ee1
commit
55d78e11eb
1 changed files with 2 additions and 1 deletions
|
|
@ -29,7 +29,8 @@ DAEMONIZE_NOTIFY_SIGNALS = [
|
|||
# The foreground process waits for the notify signals with signal.sigwait() (which, unlike
|
||||
# signal.sigtimedwait(), is also available on macOS). To still honor the timeout, we arm a
|
||||
# SIGALRM timer and wait for it as well, so it must be blocked and waited for, too.
|
||||
DAEMONIZE_WAIT_SIGNALS = DAEMONIZE_NOTIFY_SIGNALS + [signal.SIGALRM]
|
||||
# SIGALRM is not available on Windows (where daemonizing is not supported anyway).
|
||||
DAEMONIZE_WAIT_SIGNALS = DAEMONIZE_NOTIFY_SIGNALS + ([signal.SIGALRM] if hasattr(signal, "SIGALRM") else [])
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
|
|
|
|||
Loading…
Reference in a new issue