Skip to content

Commit 59a684e

Browse files
committed
Fix python 2.7
Signed-off-by: Bert Kleewein <bertk@microsoft.com>
1 parent 3d47d37 commit 59a684e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/paho/mqtt/client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@
8181
else:
8282
EAGAIN = errno.EAGAIN
8383

84+
# Python 2.7 does not have BlockingIOError. Fall back to IOError
85+
try:
86+
BlockingIOError
87+
except NameError:
88+
BlockingIOError = IOError
89+
8490
MQTTv31 = 3
8591
MQTTv311 = 4
8692
MQTTv5 = 5

0 commit comments

Comments
 (0)