|
2 | 2 |
|
3 | 3 | try: |
4 | 4 | from itertools import zip_longest as izip_longest, repeat # pylint: disable-msg=E0611 |
5 | | -except ImportError: # python 2 |
6 | | - from itertools import izip_longest as izip_longest, repeat |
| 5 | +except ImportError: |
| 6 | + from itertools import izip_longest as izip_longest, repeat # python 2 |
7 | 7 | import logging |
| 8 | +try: |
| 9 | + from Queue import Empty, Queue # python 3 |
| 10 | +except ImportError: |
| 11 | + from queue import Empty, Queue # python 2 |
| 12 | +import sys |
8 | 13 | import time |
9 | 14 |
|
10 | 15 | import six |
11 | | -import sys |
12 | | - |
13 | | -try: |
14 | | - from Queue import Empty, Queue |
15 | | -except ImportError: # python 2 |
16 | | - from queue import Empty, Queue |
17 | 16 |
|
18 | | -from kafka.common import ( |
19 | | - FetchRequest, OffsetRequest, |
20 | | - ConsumerFetchSizeTooSmall, ConsumerNoMoreData, |
21 | | - UnknownTopicOrPartitionError, NotLeaderForPartitionError, |
22 | | - OffsetOutOfRangeError, FailedPayloadsError, check_error |
23 | | -) |
24 | 17 | from .base import ( |
25 | 18 | Consumer, |
26 | 19 | FETCH_DEFAULT_BLOCK_TIMEOUT, |
|
33 | 26 | ITER_TIMEOUT_SECONDS, |
34 | 27 | NO_MESSAGES_WAIT_TIME_SECONDS |
35 | 28 | ) |
| 29 | +from ..common import ( |
| 30 | + FetchRequest, OffsetRequest, |
| 31 | + ConsumerFetchSizeTooSmall, ConsumerNoMoreData, |
| 32 | + UnknownTopicOrPartitionError, NotLeaderForPartitionError, |
| 33 | + OffsetOutOfRangeError, FailedPayloadsError, check_error |
| 34 | +) |
36 | 35 |
|
37 | 36 |
|
38 | 37 | log = logging.getLogger(__name__) |
|
0 commit comments