Skip to content

Commit 039c946

Browse files
committed
Python code ported to python3
1 parent 54cbb76 commit 039c946

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

librabbitmq/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from __future__ import absolute_import
22

3+
import sys
34
import itertools
5+
from six.moves import xrange
46

57
import _librabbitmq
68

@@ -43,7 +45,10 @@ class Channel(object):
4345
def __init__(self, connection, channel_id):
4446
self.connection = connection
4547
self.channel_id = channel_id
46-
self.next_consumer_tag = itertools.count(1).next
48+
if sys.version_info.major == 2:
49+
self.next_consumer_tag = itertools.count(1).next
50+
else:
51+
self.next_consumer_tag = itertools.count(1).__next__
4752
self.no_ack_consumers = set()
4853

4954
def __enter__(self):

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ def find_make(alt=('gmake', 'gnumake', 'make', 'nmake')):
210210
cmdclass=cmdclass,
211211
install_requires=[
212212
'amqp>=1.4.6',
213+
'six>=1.0.0',
213214
],
214215
ext_modules=ext_modules,
215216
classifiers=[

0 commit comments

Comments
 (0)