diff --git a/kafka/conn.py b/kafka/conn.py index a1b0a80e3..a577ebaea 100644 --- a/kafka/conn.py +++ b/kafka/conn.py @@ -1,8 +1,8 @@ import copy import logging +from random import shuffle import socket import struct -from random import shuffle from threading import local from kafka.common import ConnectionError diff --git a/kafka/consumer.py b/kafka/consumer.py index 0935dd223..928bbac02 100644 --- a/kafka/consumer.py +++ b/kafka/consumer.py @@ -8,12 +8,12 @@ from multiprocessing import Process, Queue as MPQueue, Event, Value from Queue import Empty, Queue -import kafka +import kafka.common from kafka.common import ( - FetchRequest, - OffsetRequest, OffsetCommitRequest, - OffsetFetchRequest, - ConsumerFetchSizeTooSmall, ConsumerNoMoreData + FetchRequest, OffsetRequest, + OffsetCommitRequest, OffsetFetchRequest, + ConsumerFetchSizeTooSmall, ConsumerNoMoreData, + UnknownTopicOrPartitionError ) from kafka.util import ReentrantTimer @@ -114,7 +114,7 @@ def get_or_init_offset_callback(resp): try: kafka.common.check_error(resp) return resp.offset - except kafka.common.UnknownTopicOrPartitionError: + except UnknownTopicOrPartitionError: return 0 for partition in partitions: