aboutsummaryrefslogtreecommitdiffstats
path: root/Pubnub.py
diff options
context:
space:
mode:
authorDevendra2014-05-07 18:11:35 +0530
committerDevendra2014-05-07 18:11:35 +0530
commit4a14f1f57546a7ccb24b9ced41f5743c3f49f96e (patch)
treefb2b1791464e937371c8096711542a5453849c2f /Pubnub.py
parent8e3ee358718686a2292b555e1184eb817b2a051a (diff)
downloadpubnub-python-4a14f1f57546a7ccb24b9ced41f5743c3f49f96e.tar.bz2
check for channel length 0 in subscribe
Diffstat (limited to 'Pubnub.py')
-rw-r--r--Pubnub.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/Pubnub.py b/Pubnub.py
index ee9371a..4ae27ab 100644
--- a/Pubnub.py
+++ b/Pubnub.py
@@ -806,8 +806,9 @@ class PubnubCoreAsync(PubnubBase):
channels, list) else channels.split(",")
for channel in channels:
## New Channel?
- if not channel in self.subscriptions or \
- self.subscriptions[channel]['subscribed'] is False:
+ if len(channel) > 0 and \
+ (not channel in self.subscriptions or
+ self.subscriptions[channel]['subscribed'] is False):
with self._channel_list_lock:
self.subscriptions[channel] = {
'name': channel,
@@ -1131,12 +1132,14 @@ def _requests_request(url, timeout=320):
try:
resp = s.get(url, timeout=timeout)
except requests.exceptions.HTTPError as http_error:
+ print http_error
resp = http_error
except requests.exceptions.ConnectionError as error:
+ print error
msg = str(error)
return (json.dumps(msg), 0)
except requests.exceptions.Timeout as error:
- #print(error);
+ print(error)
#print('timeout');
msg = str(error)
return (json.dumps(msg), 0)