Permalink
Browse files

Do not add callback for PUB/SUB connections

  • Loading branch information...
1 parent 09b8c49 commit e43cd6c84b4aff287a40539850d113d6847b0ced @mrjoes committed Dec 26, 2012
Showing with 13 additions and 6 deletions.
  1. +6 −0 debian/changelog
  2. +7 −6 toredis/client.py
View
@@ -1,3 +1,9 @@
+python-toredis (0.0.7) unstable; urgency=low
+
+ * New build.
+
+ -- Serge S. Koval <serge.koval+github@gmail.com> Wed, 26 Dec 2012 14:16:39 +0200
+
python-toredis (0.0.6) unstable; urgency=low
* New build.
View
@@ -134,7 +134,7 @@ def psubscribe(self, patterns, callback=None):
callback
"""
self._set_sub_callback(callback)
- super(Client, self).psubscribe(patterns, callback)
+ super(Client, self).psubscribe(patterns)
def subscribe(self, channels, callback=None):
"""
@@ -146,7 +146,7 @@ def subscribe(self, channels, callback=None):
Callback
"""
self._set_sub_callback(callback)
- super(Client, self).subscribe(channels, callback)
+ super(Client, self).subscribe(channels)
def _set_sub_callback(self, callback):
if self._sub_callback is None:
@@ -197,10 +197,11 @@ def _on_close(self, data=None):
if callbacks:
for cb in callbacks:
- try:
- cb(None)
- except:
- logger.exception('Exception in callback')
+ if cb is not None:
+ try:
+ cb(None)
+ except:
+ logger.exception('Exception in callback')
if self._sub_callback is not None:
try:

0 comments on commit e43cd6c

Please sign in to comment.