Skip to content

Commit da25563

Browse files
author
Joe Crobak
committed
Enable absolute imports for modules using Queue.
When running on Linux with code on a case-insensitive file system, imports of the `Queue` module fail because python resolves the wrong file (It is trying to use a relative import of `queue.py` in the kafka directory). This change forces absolute imports via PEP328.
1 parent 33cde52 commit da25563

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

kafka/consumer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import absolute_import
2+
13
from collections import defaultdict
24
from itertools import izip_longest, repeat
35
import logging

kafka/producer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import absolute_import
2+
13
from collections import defaultdict
24
from datetime import datetime, timedelta
35
from itertools import cycle

kafka/queue.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import absolute_import
2+
13
from copy import copy
24
import logging
35
from multiprocessing import Process, Queue, Event

0 commit comments

Comments
 (0)