Commits

Darrell Schiebel authored and Sandra Castro committed ea623b868f4 Merge
Pull request #678: close config file handle [CAS-14065]

Merge in CASA/casa6 from CAS-14065 to master * commit 'c0ad0890bb85d9db624ce3984d656eeb273a98e9': close config file handle [CAS-14065]

casatools/src/python/ctuser.py

Modified
99 99 try:
100 100 from casatoolrc import *
101 101 except:
102 102 try:
103 103 f = open(configrc)
104 104 except IOError:
105 105 pass
106 106 else:
107 107 f.close()
108 108 try:
109 - exec(open(configrc).read( ))
109 + with open(configrc) as rc:
110 + exec(rc.read( ))
110 111 except:
111 112 sys.stderr.write("error: evaluation of %s failed\n" % configrc)

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut