don't forget to call superclass __init__

This commit is contained in:
Vetoshkin Nikita
2013-10-03 18:19:54 +04:00
committed by David Arthur
parent 3ba54c6e05
commit 4ccfa5ce76
2 changed files with 3 additions and 1 deletions

View File

@@ -17,6 +17,7 @@ class KafkaConnection(local):
since the Kafka API includes a correlation id. since the Kafka API includes a correlation id.
""" """
def __init__(self, host, port, bufsize=4096): def __init__(self, host, port, bufsize=4096):
super(KafkaConnection, self).__init__()
self.host = host self.host = host
self.port = port self.port = port
self.bufsize = bufsize self.bufsize = bufsize

View File

@@ -31,7 +31,8 @@ class RoundRobinPartitioner(Partitioner):
in a round robin fashion in a round robin fashion
""" """
def __init__(self, partitions): def __init__(self, partitions):
self._set_partitions(partitions) super(RoundRobinPartitioner, self).__init__(partitions)
self.iterpart = cycle(partitions)
def _set_partitions(self, partitions): def _set_partitions(self, partitions):
self.partitions = partitions self.partitions = partitions