Browse Source

pygrass: decode only if stdout/stderr not empty

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@74496 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 6 years ago
parent
commit
ec44b8432e
1 changed files with 2 additions and 4 deletions
  1. 2 4
      lib/python/pygrass/modules/interface/module.py

+ 2 - 4
lib/python/pygrass/modules/interface/module.py

@@ -782,10 +782,8 @@ class Module(object):
             if self.stdin:
                 self.stdin = encode(self.stdin)
             stdout, stderr = self.popen.communicate(input=self.stdin)
-            stdout = decode(stdout)
-            stderr = decode(stderr)
-            self.outputs['stdout'].value = stdout if stdout else ''
-            self.outputs['stderr'].value = stderr if stderr else ''
+            self.outputs['stdout'].value = decode(stdout) if stdout else ''
+            self.outputs['stderr'].value = decode(stderr) if stderr else ''
             self.time = time.time() - self.start_time
 
             self._finished = True