Skip to content

Commit

Permalink
r.catchment: read stdout as text, Python 3 update (#530)
Browse files Browse the repository at this point in the history
  • Loading branch information
nilason committed Apr 24, 2022
1 parent bd38a29 commit 7f52a16
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/raster/r.catchment/r.catchment.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,12 @@
def out2dictnum(m, n, o):
"""Execute a grass command, and parse it to a dictionary
This works differently than standard grass.parse_command syntax"""
p1 = subprocess.Popen("%s" % m, stdout=subprocess.PIPE, shell="bash")
p1 = subprocess.Popen(
"%s" % m,
stdout=subprocess.PIPE,
shell=True,
universal_newlines=True,
)
p2 = p1.stdout.readlines()
for y in p2:
y0, y1 = y.split("%s" % n)
Expand Down

0 comments on commit 7f52a16

Please sign in to comment.