@@ -18,8 +18,8 @@ def generate_subsystem_lib_name():
1818
1919def generate_ld_preload (scorep_config ):
2020 """
21- This functions generate a string that needs to be passed to $LD_PRELOAD.
22- After this sting is passed, the tracing needs to be restarted with this $LD_PRELOAD in env.
21+ This functions generates a string that needs to be passed to $LD_PRELOAD.
22+ After this string is passed, the tracing needs to be restarted with this $LD_PRELOAD in env.
2323
2424 @return ld_preload string which needs to be passed to LD_PRELOAD
2525 """
@@ -103,15 +103,12 @@ def init_environment(scorep_config=[], keep_files=False):
103103 """
104104 Set the inital needed environmet variables, to get everythin up an running.
105105 As a few variables interact with LD env vars, the programms needs to be restarted after this.
106- The function set the env var `SCOREP_PYTHON_BINDINGS_INITALISED` to true, once it is done with
107- initalising.
108106
109107 @param scorep_config configuration flags for score-p
110108 @param keep_files whether to keep the generated files, or not.
111109 """
112110
113- if ("LD_PRELOAD" in os .environ ) and (
114- "libscorep" in os .environ ["LD_PRELOAD" ]):
111+ if "libscorep" in os .environ .get ("LD_PRELOAD" , "" ):
115112 raise RuntimeError (
116113 "Score-P is already loaded. This should not happen at this point" )
117114
@@ -132,7 +129,7 @@ def init_environment(scorep_config=[], keep_files=False):
132129 os .environ ["LD_PRELOAD" ] = preload_str
133130
134131
135- def reset_pereload ():
132+ def reset_preload ():
136133 """
137134 resets the environment variable `LD_PRELOAD` to the value before init_environment was called.
138135 """
@@ -152,6 +149,5 @@ def clean_up(keep_files=True):
152149 if keep_files :
153150 return
154151 else :
155- if ("SCOREP_PYTHON_BINDINGS_TEMP_DIR" in os .environ ) and (
156- os .environ ["SCOREP_PYTHON_BINDINGS_TEMP_DIR" ] != "" ):
152+ if os .environ .get ("SCOREP_PYTHON_BINDINGS_TEMP_DIR" ):
157153 shutil .rmtree (os .environ ["SCOREP_PYTHON_BINDINGS_TEMP_DIR" ])
0 commit comments