From b8da2369fe6823942446a55ecd7b734fd0dc5cfd Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 20 Oct 2010 03:51:29 -0400 Subject: [PATCH] Teardown manager after use in velocity_dependant_scan.main(). --- pysawsim/velocity_dependant_scan.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/pysawsim/velocity_dependant_scan.py b/pysawsim/velocity_dependant_scan.py index caf3d30..bb29272 100644 --- a/pysawsim/velocity_dependant_scan.py +++ b/pysawsim/velocity_dependant_scan.py @@ -276,12 +276,14 @@ def main(): sawsim_histogram.CACHE_DIR = options.cache_dir manager = get_manager(options.manager)() - - hm = HistogramMatcher( - file(velocity_file, 'r'), param_format_string=options.param_format, - N=options.N, manager=manager, residual_type=options.residual, - plot=options.plot_residuals, use_cache=options.use_cache, - clean_cache=options.clean_cache) - #hm.fit(initial_params) - hm.plot(param_ranges, logx=options.logx, logy=options.logy, - contour=options.contour_plot) + try: + hm = HistogramMatcher( + file(velocity_file, 'r'), param_format_string=options.param_format, + N=options.N, manager=manager, residual_type=options.residual, + plot=options.plot_residuals, use_cache=options.use_cache, + clean_cache=options.clean_cache) + #hm.fit(initial_params) + hm.plot(param_ranges, logx=options.logx, logy=options.logy, + contour=options.contour_plot) + finally: + manager.teardown() -- 2.26.2