Skip to content

Commit d7592a6

Browse files
authored
Merge pull request #497 from Brishen/master
Fix for Python 3.9 moving Iterable to collections.abc
2 parents 11238da + e1c4557 commit d7592a6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/paho/mqtt/publish.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
from __future__ import absolute_import
2222

2323
import collections
24+
try:
25+
from collections.abc import Iterable
26+
except ImportError:
27+
from collections import Iterable
2428

2529
from . import client as paho
2630
from .. import mqtt
@@ -124,7 +128,7 @@ def multiple(msgs, hostname="localhost", port=1883, client_id="", keepalive=60,
124128
proxy_args: a dictionary that will be given to the client.
125129
"""
126130

127-
if not isinstance(msgs, collections.Iterable):
131+
if not isinstance(msgs, Iterable):
128132
raise TypeError('msgs must be an iterable')
129133

130134
client = paho.Client(client_id=client_id, userdata=collections.deque(msgs),

0 commit comments

Comments
 (0)