From: Barış Metin Date: Mon, 6 Apr 2009 10:18:22 +0000 (+0000) Subject: guard AuthCheck with try/except as it will raise an exception. X-Git-Tag: NodeManager-1.8-8~27 X-Git-Url: http://git.onelab.eu/?p=nodemanager.git;a=commitdiff_plain;h=c484e6e613a4016d33471b517bc6298ca5b997d0 guard AuthCheck with try/except as it will raise an exception. --- diff --git a/plcapi.py b/plcapi.py index e38b0a5..03a9ca7 100644 --- 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: