guard AuthCheck with try/except as it will raise an exception.
authorBarış Metin <Talip-Baris.Metin@sophia.inria.fr>
Mon, 6 Apr 2009 10:18:22 +0000 (10:18 +0000)
committerBarış Metin <Talip-Baris.Metin@sophia.inria.fr>
Mon, 6 Apr 2009 10:18:22 +0000 (10:18 +0000)
plcapi.py

index e38b0a5..03a9ca7 100644 (file)
--- a/plcapi.py
+++ b/plcapi.py
@@ -53,7 +53,10 @@ class PLCAPI:
         # just a simple call to check authentication
         def check():
             if (self.node_id and self.key) or self.session:
-                if self.AuthCheck() == 1: return True
+                try:
+                    if self.AuthCheck() == 1: return True
+                except:
+                    return False
             return False
         if not check():
             if self.node_id and self.key: