Sfoglia il codice sorgente

wxGUI: simplify gcmd.Popen constructor

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@49168 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 13 anni fa
parent
commit
f6b074d551
1 ha cambiato i file con 3 aggiunte e 9 eliminazioni
  1. 3 9
      gui/wxpython/gui_modules/gcmd.py

+ 3 - 9
gui/wxpython/gui_modules/gcmd.py

@@ -111,17 +111,11 @@ class GException(Exception):
 
 class Popen(subprocess.Popen):
     """!Subclass subprocess.Popen"""
-    def __init__(self, *args, **kwargs):
+    def __init__(self, args, **kwargs):
         if subprocess.mswindows:
-            try:
-                kwargs['args'] = map(utils.EncodeString, kwargs['args'])
-            except KeyError:
-                if len(args) > 0:
-                    targs = list(args)
-                    targs[0] = map(utils.EncodeString, args[0])
-                    args = tuple(targs)
+            args = map(utils.EncodeString, args)
         
-        subprocess.Popen.__init__(self, *args, **kwargs)
+        subprocess.Popen.__init__(self, args, **kwargs)
         
     def recv(self, maxsize = None):
         return self._recv('stdout', maxsize)