From c484e6e613a4016d33471b517bc6298ca5b997d0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bar=C4=B1=C5=9F=20Metin?= Date: Mon, 6 Apr 2009 10:18:22 +0000 Subject: [PATCH] guard AuthCheck with try/except as it will raise an exception. --- plcapi.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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: -- 2.43.0