From 1dbf9f01e42482e3d0c7507cd1f6377c6b23a4c0 Mon Sep 17 00:00:00 2001 From: Sergey Golitsynskiy Date: Thu, 24 Oct 2019 15:00:34 -0400 Subject: [PATCH] Do not raise Exception to manage control flow --- lib/galaxy/util/properties.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/galaxy/util/properties.py b/lib/galaxy/util/properties.py index aa24b6626c6..000344fe132 100644 --- a/lib/galaxy/util/properties.py +++ b/lib/galaxy/util/properties.py @@ -190,14 +190,8 @@ class NicerConfigParser(ConfigParser): def _running_from_source(): - try: - # is there a better way to do this? - assert os.path.exists('run.sh') - assert os.path.exists('lib/galaxy/__init__.py') - assert os.path.exists('scripts/common_startup.sh') - return True - except AssertionError: - return False + paths = ['run.sh', 'lib/galaxy/__init__.py', 'scripts/common_startup.sh'] + return all(map(os.path.exists, paths)) running_from_source = _running_from_source()