From 3e05638c6203a2fe273e66298b1f2a3f830e7f84 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Wed, 17 Jan 2018 21:54:58 +0100 Subject: [PATCH] little improvement in config --- boswatch/config.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/boswatch/config.py b/boswatch/config.py index 4e3ad8c..16b2b00 100644 --- a/boswatch/config.py +++ b/boswatch/config.py @@ -50,11 +50,10 @@ class Config: Shares the local _config to the class wide global _sharedConfig @param sharePoint: Name of the global share point @return True or False""" - try: - bool(self._sharePoints[sharePoint]) # todo not a nice method to check + if sharePoint in self._sharePoints: logging.error("cannot share config - name is always in use: %s", sharePoint) return False - except: + else: self._sharePoints[sharePoint] = self._config logging.debug("add config sharePoint: %s", sharePoint) return True