From 03d37dff5c707599e2f268dccb4cccafbeadd5e3 Mon Sep 17 00:00:00 2001 From: Dana Powers Date: Sun, 3 Jan 2016 19:50:21 -0800 Subject: Import queue from six.moves --- kafka/consumer/multiprocess.py | 6 ++---- kafka/consumer/simple.py | 5 +---- 2 files changed, 3 insertions(+), 8 deletions(-) (limited to 'kafka') diff --git a/kafka/consumer/multiprocess.py b/kafka/consumer/multiprocess.py index d0e2920..a348d1a 100644 --- a/kafka/consumer/multiprocess.py +++ b/kafka/consumer/multiprocess.py @@ -3,12 +3,10 @@ from __future__ import absolute_import from collections import namedtuple import logging from multiprocessing import Process, Manager as MPManager -try: - import queue # python 3 -except ImportError: - import Queue as queue # python 2 import time +from six.moves import queue + from ..common import KafkaError from .base import ( Consumer, diff --git a/kafka/consumer/simple.py b/kafka/consumer/simple.py index 946e9c7..abeac7b 100644 --- a/kafka/consumer/simple.py +++ b/kafka/consumer/simple.py @@ -5,14 +5,11 @@ try: except ImportError: from itertools import izip_longest as izip_longest, repeat # pylint: disable=E0611 import logging -try: - import queue # python 3 -except ImportError: - import Queue as queue # python 2 import sys import time import six +from six.moves import queue from .base import ( Consumer, -- cgit v1.2.1