Skip to content

Commit

Permalink
Merge pull request #8 from slieberth/fix_collections_iterable_issue_i…
Browse files Browse the repository at this point in the history
…n_python_3_10

Fix collections iterable issue in python 3 10
  • Loading branch information
GIC-de authored Jul 8, 2024
2 parents a6bcfa9 + 4082e54 commit 49fa50f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ancp/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
import struct
import socket
import logging
import collections

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

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -173,7 +177,7 @@ def port_up(self, subscribers):
:param subscriber: collection of ANCP subscribers
:type subscriber: [ancp.subscriber.Subscriber]
"""
if not isinstance(subscribers, collections.Iterable):
if not isinstance(subscribers, Iterable):
subscribers = [subscribers]
elif len(subscribers) == 0:
raise ValueError("No Subscribers passed")
Expand All @@ -187,7 +191,7 @@ def port_down(self, subscribers):
:param subscriber: collection of ANCP subscribers
:type subscriber: [ancp.subscriber.Subscriber]
"""
if not isinstance(subscribers, collections.Iterable):
if not isinstance(subscribers, Iterable):
subscribers = [subscribers]
elif len(subscribers) == 0:
raise ValueError("No Subscribers passed")
Expand Down

0 comments on commit 49fa50f

Please sign in to comment.