[PATCH 04 of 24 Openidrelay cube] [py3] use except new syntax

Nsukami Patrick ptrck at nskm.xyz
Wed Apr 1 09:53:47 CEST 2020


# HG changeset patch
# User Nsukami Patrick <ptrck at nskm dot xyz>
# Date 1585471128 0
#      Sun Mar 29 08:38:48 2020 +0000
# Node ID 9c9eb6b215371f617d10d650fed507a7387b35eb
# Parent  a59072710e63aeff9aae79e6f4613153afac54cc
[py3] use except new syntax

diff --git a/cubicweb_openidrelay/authplugin.py b/cubicweb_openidrelay/authplugin.py
--- a/cubicweb_openidrelay/authplugin.py
+++ b/cubicweb_openidrelay/authplugin.py
@@ -25,7 +25,7 @@
             rset = session.execute(self.auth_rql, args)
             if rset:
                 return rset[0][0]
-        except Exception, exc:
+        except Exception as exc:
             session.debug('authentication failure (%s)', exc)
             pass
         raise AuthenticationError('user is not registered')
diff --git a/cubicweb_openidrelay/views.py b/cubicweb_openidrelay/views.py
--- a/cubicweb_openidrelay/views.py
+++ b/cubicweb_openidrelay/views.py
@@ -56,7 +56,7 @@
     req.cnx = None
     try:
         self.appli.session_handler.set_session(req)
-    except Redirect, r:
+    except Redirect as r:
         pass
     assert req.user.login == login
 
@@ -194,7 +194,7 @@
             confirm_url = self._build_url('openid-confirm')
             try:
                 auth_req = negotiator.begin(openiduri)
-            except consumer.DiscoveryFailure, exc:
+            except consumer.DiscoveryFailure as exc:
                 self.error('discovery failure: %s', exc)
                 raise Redirect(self._build_url(__message='discovery failure'))
             # we have to request a bit redundantly as openid providers




More information about the cubicweb-devel mailing list