浏览代码

python3: shutil.which and subprocess.Popen.__init__ internally use strings, so forcing bytes here raises exceptions (#48)

Huidae Cho 5 年之前
父节点
当前提交
cea7431423
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      lib/python/script/core.py

+ 1 - 2
lib/python/script/core.py

@@ -1463,8 +1463,7 @@ def find_program(pgm, *args):
     nuldev = open(os.devnull, 'w+')
     try:
         # TODO: the doc or impl is not correct, any return code is accepted
-        cmd = list(map(lambda x: encode(x), [pgm] + list(args)))
-        call(cmd, stdin = nuldev, stdout = nuldev, stderr = nuldev)
+        call([pgm] + list(args), stdin = nuldev, stdout = nuldev, stderr = nuldev)
         found = True
     except:
         found = False