Skip to content

Commit be131f2

Browse files
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>
1 parent 5c0404f commit be131f2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/borg/helpers/process.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
# The foreground process waits for the notify signals with signal.sigwait() (which, unlike
3030
# signal.sigtimedwait(), is also available on macOS). To still honor the timeout, we arm a
3131
# SIGALRM timer and wait for it as well, so it must be blocked and waited for, too.
32-
DAEMONIZE_WAIT_SIGNALS = DAEMONIZE_NOTIFY_SIGNALS + [signal.SIGALRM]
32+
# SIGALRM is not available on Windows (where daemonizing is not supported anyway).
33+
DAEMONIZE_WAIT_SIGNALS = DAEMONIZE_NOTIFY_SIGNALS + ([signal.SIGALRM] if hasattr(signal, "SIGALRM") else [])
3334

3435

3536
@contextlib.contextmanager

0 commit comments

Comments
 (0)