From 55c6534137e72f89b4ad7b37e2a21ea9bd8fbb87 Mon Sep 17 00:00:00 2001
From: David Hoese <david.hoese@ssec.wisc.edu>
Date: Tue, 2 Mar 2021 20:42:37 -0600
Subject: [PATCH] Fix syntax errors in legacy_nc

---
 metobscommon/util/legacy_nc.py | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/metobscommon/util/legacy_nc.py b/metobscommon/util/legacy_nc.py
index df45254..5e01d6e 100644
--- a/metobscommon/util/legacy_nc.py
+++ b/metobscommon/util/legacy_nc.py
@@ -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'):
-- 
GitLab