Skip to content

Commit

Permalink
Merge pull request #30 from rayosborn/fix-links
Browse files Browse the repository at this point in the history
Fixes a bug when updating links. Updating links in an existing file was failing because the file was not opened with the right file mode.
  • Loading branch information
rayosborn authored May 8, 2017
2 parents 556481f + 7f51748 commit 51722bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/nexusformat/nexus/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -3632,10 +3632,10 @@ def update(self):
filename, mode = root.nxfilename, root.nxfilemode
item = None
if (filename is not None and os.path.exists(filename) and mode == 'rw'):
with NXFile(filename) as f:
with NXFile(filename, mode) as f:
f.update(self)
if self._filename and os.path.exists(self.nxfilename):
with NXFile(self.nxfilename) as f:
with NXFile(self.nxfilename, self.nxfilemode) as f:
if self._target in f:
item = f.readpath(self._target)
if isinstance(item, NXfield):
Expand Down

0 comments on commit 51722bb

Please sign in to comment.