Commit 42f5fe94 authored by Nsukami Patrick's avatar Nsukami Patrick
Browse files

New style: make source py2 & py3 compatible

- fix NameError: name 'unicode' is not defined
- fix SyntaxError: invalid syntax
parent a03fad2b1fd0
......@@ -54,7 +54,7 @@ class XRemoteUserAuthentifier(native.BaseAuthentifier):
raise AuthenticationError('wrong user secret')
rset = session.execute(self.auth_rql, {'login': clearlogin})
return rset[0][0]
except Exception, exc:
except Exception as exc:
session.debug('authentication failure (%s)', exc)
pass
raise AuthenticationError('user is not registered')
......@@ -14,7 +14,7 @@
# You should have received a copy of the GNU Lesser General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
_ = unicode
from cubicweb import _
options = (
('trustedauth-secret-key-file',
......
......@@ -56,7 +56,7 @@ class XRemoteUserRetriever(authentication.WebAuthInfoRetriever):
# need a multiple of 16 in length
secret = cyphr.encrypt('%128s' % login)
return login, {'secret': base64.encodestring(secret)}
except Exception, exc:
except Exception as exc:
self.debug('web authenticator failed (%s)', exc)
raise authentication.NoAuthInfo()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment