diff options
author | Dana Powers <dana.powers@gmail.com> | 2016-11-20 12:44:55 -0800 |
---|---|---|
committer | Dana Powers <dana.powers@gmail.com> | 2016-11-20 12:44:55 -0800 |
commit | c4a6e1aa68fc48dd589ff64e1247d2886ccfa3fd (patch) | |
tree | 59eac87bcafe200e454155d5eb45ffaf863c0d0d | |
parent | 5ad6f52a802c38b97e1fe4f6afa711ff1415d02f (diff) | |
download | kafka-python-c4a6e1aa68fc48dd589ff64e1247d2886ccfa3fd.tar.gz |
Use six.string_types for topic type check in #824
-rw-r--r-- | kafka/consumer/subscription_state.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kafka/consumer/subscription_state.py b/kafka/consumer/subscription_state.py index 4366010..9e7f080 100644 --- a/kafka/consumer/subscription_state.py +++ b/kafka/consumer/subscription_state.py @@ -133,7 +133,7 @@ class SubscriptionState(object): if self._user_assignment: raise IllegalStateError(self._SUBSCRIPTION_EXCEPTION_MESSAGE) - if isinstance(topics, str): + if isinstance(topics, six.string_types): topics = [topics] if self.subscription == set(topics): @@ -141,7 +141,7 @@ class SubscriptionState(object): topics) return - if any(not isinstance(t, str) for t in topics): + if any(not isinstance(t, six.string_types) for t in topics): raise TypeError('All topics must be strings') log.info('Updating subscribed topics to: %s', topics) |