Commits

Takeshi Nakazato authored 6e305263678
CAS-13713 bug fix on environment_variable_manager

casatasks/tests/tasks/test_task_sdatmcor.py

Modified
89 89 for colname in ['DATA', 'FLOAT_DATA', 'CORRECTED_DATA']:
90 90 if colname in colnames:
91 91 data = tsel.getcol(colname)
92 92 tsel.putcol(colname, data * factor)
93 93 finally:
94 94 tsel.close()
95 95
96 96
97 97 @contextlib.contextmanager
98 98 def environment_variable_manager(var_name):
99 - var_org = os.environ[var_name]
99 + var_org = os.environ.get(var_name)
100 100 try:
101 101 yield var_org
102 102 finally:
103 103 if var_org is None:
104 - os.environ.pop(var_name)
104 + os.environ.pop(var_name, None)
105 105 else:
106 106 os.environ[var_name] = var_org
107 107
108 108
109 109 class test_sdatmcor(unittest.TestCase):
110 110 datapath = ctsys_resolve('measurementset/almasd')
111 111 infile = 'X320b_sel2.ms'
112 112 outfile = infile + '.atmcor'
113 113 caltable = infile + '.k2jycal'
114 114

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

Add shortcut