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

Fix for Python 3.9 moving Iterable to collections.abc #497

Merged
merged 1 commit into from
Jul 29, 2020
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
6 changes: 5 additions & 1 deletion src/paho/mqtt/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
from __future__ import absolute_import

import collections
try:
from collections.abc import Iterable
except ImportError:
from collections import Iterable

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

if not isinstance(msgs, collections.Iterable):
if not isinstance(msgs, Iterable):
raise TypeError('msgs must be an iterable')

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