From 87262b429d633420402e735a770f6d6cfedecf9a Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Fri, 25 Sep 2020 11:22:34 +1000 Subject: Move all python commands to use env python - If you host does not provide a python command consult the User manual for ways you can run the python commands. - Full package paths are being used to avoid namespace pollution and crosstalk. --- rtemstoolkit/rtems.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'rtemstoolkit') diff --git a/rtemstoolkit/rtems.py b/rtemstoolkit/rtems.py index 30c8c16..c7dcd9c 100755 --- a/rtemstoolkit/rtems.py +++ b/rtemstoolkit/rtems.py @@ -71,10 +71,7 @@ def configuration_path(prog = None): 2. Ok to directly call os.path. ''' if prog is None: - if len(sys.argv) == 1: - exec_name = sys.argv[0] - else: - exec_name = sys.argv[1] + exec_name = sys.argv[0] else: exec_name = prog exec_name = os.path.abspath(exec_name) @@ -157,8 +154,10 @@ class configuration: for arch in profile['archs']: bsps = 'bsps_%s' % (arch) profile[bsps] = self.config.comma_list(profile['name'], bsps) - self.profiles[profile['name']] = profile + self.profiles[profile['name']] = dict(profile) + profile = None invalid_chars = re.compile(r'[^a-zA-Z0-9_-]') + archs = sorted(list(set(archs))) for a in set(archs): if len(invalid_chars.findall(a)) != 0: raise error.general('invalid character(s) in arch name: %s' % (a)) -- cgit v1.2.3