Commit 042bdd24 by Sebastian Annies

use is not None as propose by future

parent 4dbf8313
......@@ -56,7 +56,7 @@ def _verify_cas2(ticket, service):
tree = ElementTree.fromstring(response)
page.close()
if tree.find(CAS + 'authenticationSuccess', namespaces=NSMAP):
if tree.find(CAS + 'authenticationSuccess', namespaces=NSMAP) is not None:
username = tree.find(CAS + 'authenticationSuccess/' + CAS + 'user', namespaces=NSMAP).text
pgtIouIdElement = tree.find(CAS + 'authenticationSuccess/' + CAS + 'proxyGrantingTicket', namespaces=NSMAP);
pgtIouId = pgtIouIdElement.text if pgtIouIdElement is not None else None
......
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