Skip to content

Commit

Permalink
Fix crash on windows (module 'signal' has no attribute 'SIGWINCH' #1924)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberw committed Nov 2, 2021
1 parent f0eff53 commit abdf0dd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion locust/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ def resize_handler(signum, frame):
STATS_NAME_WIDTH = max(min(os.get_terminal_size()[0] - 80, 80), 0)


signal.signal(signal.SIGWINCH, resize_handler)
try:
signal.signal(signal.SIGWINCH, resize_handler)
except AttributeError:
pass # Windows doesnt have SIGWINCH

STATS_TYPE_WIDTH = 8

Expand Down

0 comments on commit abdf0dd

Please sign in to comment.