Skip to content

Commit

Permalink
grass.script: ensure memmap content is flushed before writing to a ra…
Browse files Browse the repository at this point in the history
…ster (#3206)
  • Loading branch information
petrasovaa committed Oct 24, 2023
1 parent 34d02cd commit 08e2a61
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions python/grass/script/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ def write(self, mapname, title=None, null=None, overwrite=None, quiet=None):
else:
raise ValueError(_("Invalid kind <%s>") % kind)

# ensure all array content is written to the file
self.flush()

reg = gcore.region(env=self._env)

try:
Expand Down Expand Up @@ -313,6 +316,9 @@ def write(self, mapname, null=None, overwrite=None, quiet=None):
else:
raise ValueError(_("Invalid kind <%s>") % kind)

# ensure all array content is written to the file
self.flush()

reg = gcore.region(True, env=self._env)

try:
Expand Down

0 comments on commit 08e2a61

Please sign in to comment.