Skip to content
Snippets Groups Projects
Verified Commit 55c65341 authored by David Hoese's avatar David Hoese
Browse files

Fix syntax errors in legacy_nc

parent 6a660b44
Branches
No related tags found
No related merge requests found
......@@ -119,7 +119,7 @@ def create_nc_from_ncml(filename, ncml_in):
else:
len_ = dim_elem.attrib['length']
nc_dim = nc.def_dim(name, int(len_))
except CDFError, e:
except CDFError as e:
_log.error("Dimension: %s" % name, exc_info=1)
raise e
......@@ -133,7 +133,7 @@ def create_nc_from_ncml(filename, ncml_in):
value = attr_elem.attrib['value']
try:
setattr(nc, name, value)
except CDFError, e:
except CDFError as e:
_log.error("Global attr: %s" % name, exc_info=1)
raise e
......@@ -156,7 +156,7 @@ def create_nc_from_ncml(filename, ncml_in):
type_fcn = attr_type_map[var_attr.attrib['type']][1]
value = var_attr.attrib['value']
setattr(nc_var, attr_name, type_fcn(value))
except CDFError, e:
except CDFError as e:
_log.error("Processing '%s'" % var_name, exc_info=1)
raise e
nc.sync()
......@@ -172,16 +172,16 @@ class BaseCDF(object):
self.ncml_tmpl = ncml_tmpl
def write_station(self, *args):
raise NotImplementedError, "Funciton must be implemented by subclass"
raise NotImplementedError("Funciton must be implemented by subclass")
def write_globals(self, *args):
raise NotImplementedError, "Funciton must be implemented by subclass"
raise NotImplementedError("Funciton must be implemented by subclass")
def write_variables(self, stamps, data, derived=[]):
raise NotImplementedError, "Funciton must be implemented by subclass"
raise NotImplementedError("Funciton must be implemented by subclass")
def write_times(self, stamps):
raise NotImplementedError, "Funciton must be implemented by subclass"
raise NotImplementedError("Funciton must be implemented by subclass")
def __del__(self):
if hasattr(self, 'nc'):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment