From d12818cb673f8a55c30ab13703ee42a058947511 Mon Sep 17 00:00:00 2001 From: Jono Yang Date: Wed, 30 Nov 2016 11:42:39 -0800 Subject: [PATCH] #267 Modify MAPPING.CONFIG check by prepending directory of genabout.py to the path check for MAPPING.CONFIG --- about_code_tool/genabout.py | 3 ++- about_code_tool/util.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/about_code_tool/genabout.py b/about_code_tool/genabout.py index 3b6ba6ff..7e30edd8 100644 --- a/about_code_tool/genabout.py +++ b/about_code_tool/genabout.py @@ -739,7 +739,8 @@ def main(parser, options, args): print("ERROR: LICENSE_TEXT_LOCATION path does not exist.") sys.exit(errno.EINVAL) - if mapping_config and not path_exists('MAPPING.CONFIG'): + mapping_config_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'MAPPING.CONFIG') + if mapping_config and not path_exists(mapping_config_path): print("ERROR: The file 'MAPPING.CONFIG' does not exist.") sys.exit(errno.EINVAL) diff --git a/about_code_tool/util.py b/about_code_tool/util.py index 06660b06..ebc4a36d 100644 --- a/about_code_tool/util.py +++ b/about_code_tool/util.py @@ -46,7 +46,7 @@ def path_exists(location): """ Return True if the path exists. """ - return location and os.path.exists(abspath(location)) + return location and os.path.exists(abspath(location)) def canonical_path(location):