reduce() is not immediately available in Python 3. We could import it
from functools, but there's a simpler way to write the code.
Signed-off-by: Ondřej Lysoněk <olysonek(a)redhat.com>
---
procfs/procfs.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/procfs/procfs.py b/procfs/procfs.py
index 028d7bd..13c84f1 100755
--- a/procfs/procfs.py
+++ b/procfs/procfs.py
@@ -32,7 +32,7 @@ def process_cmdline(pid_info):
not available, falls back to using the comm (short process name) in its pidstat key.
"""
if pid_info["cmdline"]:
- return reduce(lambda a, b: a + " %s" % b, pid_info["cmdline"])
+ return " ".join(pid_info["cmdline"])
return pid_info["stat"]["comm"]
--
2.14.3