Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stop mangling the environments #2228

Merged
merged 5 commits into from
Dec 12, 2023
Merged

stop mangling the environments #2228

merged 5 commits into from
Dec 12, 2023

Conversation

mesmith75
Copy link
Contributor

@mesmith75 mesmith75 commented Dec 9, 2023

This keeps the enviroment as the os._Environ type which can cope with the more complex environments of newer bash shells - in particular multiline functions.

egede
egede previously approved these changes Dec 11, 2023
Comment on lines 119 to 123
self.env = dict(os.environ)
self.env = os.environ
execute('source {0} {1}'.format(setup, " ".join(setup_args)), shell=True, env=self.env, update_env=True)

else:
# bug #44334: Ganga/Utility/Shell.py does not save environ
env = dict(os.environ)
self.env = expand_vars(env)
self.env = os.environ
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the self.env = os.environ can just be put up before the if clause and then just have the execute part inside the if clause.

@mesmith75 mesmith75 requested a review from egede December 11, 2023 12:19
@mesmith75 mesmith75 merged commit 62e5e74 into develop Dec 12, 2023
9 of 11 checks passed
@mesmith75 mesmith75 deleted the sort_envs branch December 12, 2023 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants