diff --git a/core/common_radiohdl.py b/core/common_radiohdl.py index 4bcc57ab7de5b7f9887638f17eb142ad7228f6aa..78e12a00a2cba701605ff30aa5b0f4e922360260 100644 --- a/core/common_radiohdl.py +++ b/core/common_radiohdl.py @@ -2,18 +2,18 @@ # # Copyright 2018 Stichting Nederlandse Wetenschappelijk Onderzoek Instituten # ASTRON Netherlands Institute for Radio Astronomy -# +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and -# limitations under the License. +# limitations under the License. # ############################################################################### @@ -76,7 +76,7 @@ def method_name(caller_depth=0): Returns the name of the caller method. """ # Note: inspect.stack()[0][3] would return the name of this method. - return inspect.stack()[caller_depth+1][3] + return inspect.stack()[caller_depth + 1][3] def mkdir(path): diff --git a/regressiontest/modelsim_regression_test_vhdl.py b/regressiontest/modelsim_regression_test_vhdl.py index 68988248d62215a0390b0d48f4f685177dc1ada1..0e0e089c822786c55f6f92e27e2d39443e894f21 100755 --- a/regressiontest/modelsim_regression_test_vhdl.py +++ b/regressiontest/modelsim_regression_test_vhdl.py @@ -105,11 +105,10 @@ def main(args, time_ordered_tb_dict): # start 'n_proc' tb worker processes logger.info("Run all tests using %d workers", n_proc) modelsim_log_path = os.path.join(args.log_path, "modelsim") - my_env = os.environ.copy() workers = [] for i in range(n_proc): worker_id = i + 1 - worker = TestBenchWorker(worker_id, my_env, control_queue[i], task_queue, response_queue, MK_TIMEOUT, SIM_TIMEOUT, modelsim_log_path) + worker = TestBenchWorker(worker_id, control_queue[i], task_queue, response_queue, MK_TIMEOUT, SIM_TIMEOUT, modelsim_log_path) workers.append(worker) worker.start() @@ -420,10 +419,9 @@ def generate_email_report( class TestBenchWorker(multiprocessing.Process): """TestBenchWorker class is a process that will check for tasks to process in the in_queue""" - def __init__(self, worker_id, my_env, control_queue, in_queue, out_queue, max_mk_time, max_sim_time, log_path): + def __init__(self, worker_id, control_queue, in_queue, out_queue, max_mk_time, max_sim_time, log_path): multiprocessing.Process.__init__(self) self._id = worker_id - self._my_env = my_env self._ctrl = control_queue self._in = in_queue self._out = out_queue @@ -454,8 +452,8 @@ class TestBenchWorker(multiprocessing.Process): if not os.path.exists(sim_dir): os.mkdir(sim_dir) - os.putenv("HDL_IOFILE_SIM_DIR", sim_dir) - self.terminal = Terminal(print_stdout_on_timeout=True, env=my_env) + os.environ["HDL_IOFILE_SIM_DIR"] = sim_dir + self.terminal = Terminal(print_stdout_on_timeout=True) self.terminal.run_cmd(f"rm -rf {sim_dir}/*") print(self.terminal.stdout())