From e8ec81ad5d43ae7add4ecbfde3ba382ecd7ae2e8 Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Fri, 12 Sep 2014 10:35:33 +1000 Subject: [PATCH] SICS-776 Close the anti-collider file --- .../config/anticollider/anticollider_common.tcl | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/site_ansto/instrument/config/anticollider/anticollider_common.tcl b/site_ansto/instrument/config/anticollider/anticollider_common.tcl index c9b0ec8a..209a3522 100644 --- a/site_ansto/instrument/config/anticollider/anticollider_common.tcl +++ b/site_ansto/instrument/config/anticollider/anticollider_common.tcl @@ -45,13 +45,18 @@ proc handle_acscript_exception {status message args} { proc ::anticollider::loadscript {args} { variable veto_rules - set fh [open $::cfPath(anticollider)/[lindex $args 0] RDONLY ] - while {[gets $fh line] >= 0} { - # Skip empty lines and comments - if [regexp {^\s*$|^ *#} $line] { - continue + catch { + set fh [open $::cfPath(anticollider)/[lindex $args 0] RDONLY ] + while {[gets $fh line] >= 0} { + # Skip empty lines and comments + if [regexp {^\s*$|^ *#} $line] { + continue + } + lappend veto_rules $line } - lappend veto_rules $line + } + catch { + close $fh } }