Skip to content

Commit

Permalink
Catch pywintypes.error in broadcast manager (#1659)
Browse files Browse the repository at this point in the history
  • Loading branch information
zariiii9003 authored Sep 17, 2023
1 parent f3fa071 commit b794153
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion can/broadcastmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
# try to import win32event for event-based cyclic send task (needs the pywin32 package)
USE_WINDOWS_EVENTS = False
try:
import pywintypes
import win32event

# Python 3.11 provides a more precise sleep implementation on Windows, so this is not necessary.
Expand Down Expand Up @@ -263,7 +264,7 @@ def __init__(
win32event.CREATE_WAITABLE_TIMER_HIGH_RESOLUTION,
win32event.TIMER_ALL_ACCESS,
)
except (AttributeError, OSError):
except (AttributeError, OSError, pywintypes.error):
self.event = win32event.CreateWaitableTimer(None, False, None)

self.start()
Expand Down

0 comments on commit b794153

Please sign in to comment.