From 3db984a846290345b589b294a18d9dfc13cee05e Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Mon, 31 Mar 2014 19:32:49 +0200 Subject: [PATCH] clean up: simplify code --- openlp/core/common/registry.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/openlp/core/common/registry.py b/openlp/core/common/registry.py index 014a534f7..218325823 100644 --- a/openlp/core/common/registry.py +++ b/openlp/core/common/registry.py @@ -62,11 +62,9 @@ class Registry(object): registry = cls() registry.service_list = {} registry.functions_list = {} - registry.running_under_test = False - registry.initialising = True # Allow the tests to remove Registry entries but not the live system - if 'nose' in sys.argv[0]: - registry.running_under_test = True + registry.running_under_test = 'nose' in sys.argv[0] + registry.initialising = True return registry def get(self, key): @@ -128,7 +126,7 @@ class Registry(object): :param event: The function description.. :param function: The function to be called when the event happens. """ - if self.running_under_test is False: + if not self.running_under_test: trace_error_handler(log) log.error('Invalid Method call for key %s' % event) raise KeyError('Invalid Method call for key %s' % event)