diff options
| author | Devendra | 2014-05-07 18:11:35 +0530 |
|---|---|---|
| committer | Devendra | 2014-05-07 18:11:35 +0530 |
| commit | 4a14f1f57546a7ccb24b9ced41f5743c3f49f96e (patch) | |
| tree | fb2b1791464e937371c8096711542a5453849c2f | |
| parent | 8e3ee358718686a2292b555e1184eb817b2a051a (diff) | |
| download | pubnub-python-4a14f1f57546a7ccb24b9ced41f5743c3f49f96e.tar.bz2 | |
check for channel length 0 in subscribe
| -rw-r--r-- | Pubnub.py | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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) |
