Skip to content

Propagate errors with context management #161

@zshaheen

Description

@zshaheen

At lines 1260 here, we should have something like this:

def __exit__(self, type, value, traceback):
    if type is None:
        self.close()
    else:
        return False

Returning False will propagate any exceptions raised by the with block below:

with cdms2.open('something.nc') as f:
    # this is the with block

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions