Skip to content

Commit

Permalink
Support for non int-able grass versions, like 7.8dev.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michel Wortmann committed Mar 26, 2024
1 parent 3f51761 commit f0992a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modelmanager/plugins/grass.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ def __init__(self, project_or_gisdb, location=None, mapset=None,
p = subprocess.Popen(vercmd, shell=False, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
out, err = p.communicate()
self.gisversion = [int(s) for s in out.decode().strip().split('.')]
if self.gisversion[0] not in [7,8]:
self.gisversion = [s for s in out.decode().strip().split('.')]
if self.gisversion[0] not in "7 8":
raise ImportError('GRASS version {} is not supported. '
'Must be either 7.x.x or 8.x.x.'
''.format('.'.join(str(v) for v in self.gisversion)))
Expand Down

0 comments on commit f0992a0

Please sign in to comment.