[GRASS-SVN] r74496 - grass/trunk/lib/python/pygrass/modules/interface

svn_grass at osgeo.org svn_grass at osgeo.org
Thu May 16 08:39:41 PDT 2019


Author: annakrat
Date: 2019-05-16 08:39:41 -0700 (Thu, 16 May 2019)
New Revision: 74496

Modified:
   grass/trunk/lib/python/pygrass/modules/interface/module.py
Log:
pygrass: decode only if stdout/stderr not empty

Modified: grass/trunk/lib/python/pygrass/modules/interface/module.py
===================================================================
--- grass/trunk/lib/python/pygrass/modules/interface/module.py	2019-05-16 15:32:59 UTC (rev 74495)
+++ grass/trunk/lib/python/pygrass/modules/interface/module.py	2019-05-16 15:39:41 UTC (rev 74496)
@@ -782,10 +782,8 @@
             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



More information about the grass-commit mailing list