diff options
| author | Devendra | 2014-04-18 01:23:19 +0530 |
|---|---|---|
| committer | Devendra | 2014-04-18 01:23:19 +0530 |
| commit | 5d6a3e1356182663b03d62f9258d38459d49017e (patch) | |
| tree | c0433441e9862b7f1bfc1b2668d33e6e048d8866 /python-twisted | |
| parent | 85416ee30a4f54183e2be30f9ef3cc1363f98c4d (diff) | |
| download | pubnub-python-5d6a3e1356182663b03d62f9258d38459d49017e.tar.bz2 | |
fixing wrong version detection with python 2.7
Diffstat (limited to 'python-twisted')
| -rw-r--r-- | python-twisted/Pubnub.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/python-twisted/Pubnub.py b/python-twisted/Pubnub.py index b9e6b52..99eda47 100644 --- a/python-twisted/Pubnub.py +++ b/python-twisted/Pubnub.py @@ -237,8 +237,12 @@ class PubnubBase(object): self.python_version = 2 self.pc = PubnubCrypto2() else: - self.python_version = 3 - self.pc = PubnubCrypto3() + if sys.version_info.major == 2: + self.python_version = 2 + self.pc = PubnubCrypto2() + else: + self.python_version = 3 + self.pc = PubnubCrypto3() if not isinstance(self.uuid, str): raise AttributeError("pres_uuid must be a string") @@ -318,14 +322,14 @@ class PubnubBase(object): "ttl" : ttl }, callback=callback) - def revoke( self, channel, authkey=False, read=False, write=False, ttl=1, callback=None): + def revoke( self, channel, authkey=False, ttl=1, callback=None): """Revoke Access on a Channel.""" return self._pam_auth({ "channel" : channel, "auth" : authkey, - "r" : read and 1 or 0, - "w" : write and 1 or 0, + "r" : 0, + "w" : 0, "ttl" : ttl }, callback=callback) |
