@@ -105,16 +105,15 @@ def construct_result_handler(self, buildaction, report_output,
105105 def analyze (self , analyzer_cmd , res_handler , proc_callback = None , env = None ):
106106 """
107107 Run the analyzer.
108+ Don't specify the env unless really needed!
109+ The package internal or original env will be selected
110+ based on the location of the called binary.
108111 """
109112 LOG .debug ('Running analyzer ...' )
110113
111114 LOG .debug_analyzer ('\n %s' ,
112115 ' ' .join ([shlex .quote (x ) for x in analyzer_cmd ]))
113116
114- if not env :
115- env = analyzer_context .get_context ().get_env_for_bin (
116- analyzer_cmd [0 ])
117-
118117 res_handler .analyzer_cmd = analyzer_cmd
119118 try :
120119 ret_code , stdout , stderr \
@@ -149,6 +148,10 @@ def run_proc(command, cwd=None, proc_callback=None, env=None):
149148 """
150149 Just run the given command and return the return code
151150 and the stdout and stderr outputs of the process.
151+
152+ Don't specify the env unless really needed!
153+ The package internal or original env will be selected
154+ based on the location of the called binary.
152155 """
153156
154157 def signal_handler (signum , _ ):
@@ -161,6 +164,10 @@ def signal_handler(signum, _):
161164
162165 signal .signal (signal .SIGINT , signal_handler )
163166
167+ if not env :
168+ env = analyzer_context .get_context ().get_env_for_bin (
169+ command [0 ])
170+
164171 LOG .debug ('\n executing:%s\n ' , command )
165172 LOG .debug ('\n ENV:\n ' )
166173 LOG .debug (env )
0 commit comments