Skip to content

Commit 884e21f

Browse files
committed
Fixes SIGALRM usage on Windows.
Issues: Fixes #1349 Problem: SIGALRM is not available on Windows Analysis: This makes the code fallback to not using the SIGALRM if it is not importable. Tests:
1 parent 28f8c7a commit 884e21f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

f5/bigip/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
try:
2727
import signal
28+
from signal import SIGALRM
2829
HAS_SIGNAL = True
2930
except ImportError:
3031
HAS_SIGNAL = False
@@ -114,7 +115,7 @@ def _get_tmos_version(self):
114115
connect = self._meta_data['bigip']._meta_data['icr_session']
115116
base_uri = self._meta_data['uri'] + 'tm/sys/'
116117
if HAS_SIGNAL:
117-
signal.signal(signal.SIGALRM, timeout_handler)
118+
signal.signal(SIGALRM, timeout_handler)
118119
signal.alarm(int(self.args['timeout']))
119120
response = connect.get(base_uri)
120121
signal.alarm(0)

0 commit comments

Comments
 (0)