Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch pywintypes.error in broadcast manager #1659

Merged
merged 1 commit into from
Sep 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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