Skip to content

Commit

Permalink
Fixed PEP8 syntax issues in NCSS.py
Browse files Browse the repository at this point in the history
  • Loading branch information
MoonRaker committed Oct 19, 2015
1 parent e60e1f8 commit ba21c67
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions siphon/ncss.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,12 +344,12 @@ def parse_xml_dataset(elem, handle_units):
@response_handlers.register('application/x-netcdf')
@response_handlers.register('application/x-netcdf4')
def read_netcdf(data, handle_units): # pylint:disable=unused-argument
osType = platform.architecture()
if osType[1].lower() == 'windowspe':
ostype = platform.architecture()
if ostype[1].lower() == 'windowspe':
with NamedTemporaryFile(delete=False) as tmp_file:
tmp_file.write(data)
tmp_file.flush()
atexit.register(deletetempfile,tmp_file.name)
atexit.register(deletetempfile, tmp_file.name)
return Dataset(tmp_file.name, 'r')
else:
with NamedTemporaryFile() as tmp_file:
Expand All @@ -362,10 +362,11 @@ def read_netcdf(data, handle_units): # pylint:disable=unused-argument
warnings.warn('netCDF4 module not installed. '
'Will be unable to handle NetCDF returns from NCSS.')


def deletetempfile(fname):
try:
remove(fname)
except PermissionError:
except OSError:
import warnings
warnings.warn('temporary netcdf dataset file not deleted. '
'to delete temporary dataset file in the future '
Expand Down

0 comments on commit ba21c67

Please sign in to comment.