Skip to content

Commit fef44a5

Browse files
authored
Merge pull request #48 from boegel/eb_session_var
set `$___EASYBUILD___` via `prepare_main` in `main.py`
2 parents 9e78979 + b426cd9 commit fef44a5

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

easybuild/framework/easyblock.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,6 @@ def __init__(self, ec, logfile=None):
301301
self.orig_modulepath = os.getenv('MODULEPATH')
302302

303303
# keep track of initial environment we start in, so we can restore it if needed
304-
os.environ['___EASYBUILD___'] = "EasyBuild" # set an environment variable to know we are in an EB session
305304
self.initial_environ = copy.deepcopy(os.environ)
306305
self.reset_environ = None
307306
self.tweaked_env_vars = {}

easybuild/main.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,9 @@ def prepare_main(args=None, logfile=None, testing=None):
792792
:param testing: enable testing mode
793793
:return: 3-tuple with initial session state data, EasyBuildOptions instance, and tuple with configuration settings
794794
"""
795+
# set $___EASYBUILD___ environment variable to 'EasyBuild' to indicate that we're in an EasyBuild session
796+
os.environ['___EASYBUILD___'] = 'EasyBuild'
797+
795798
register_lock_cleanup_signal_handlers()
796799

797800
# if $CDPATH is set, unset it, it'll only cause trouble...

0 commit comments

Comments
 (0)