SpawnProcess: convert cgroup pids to int earlier
authorZac Medico <zmedico@gentoo.org>
Mon, 9 Sep 2013 16:56:49 +0000 (09:56 -0700)
committerZac Medico <zmedico@gentoo.org>
Mon, 9 Sep 2013 16:56:49 +0000 (09:56 -0700)
pym/_emerge/SpawnProcess.py

index 6024ef779bcb91d1c9bc75a7b577a580895927d2..b36d15f692e08fc1e4fd9c8165628e21b5217949 100644 (file)
@@ -190,7 +190,7 @@ class SpawnProcess(SubProcess):
                        def get_pids(cgroup):
                                try:
                                        with open(os.path.join(cgroup, 'cgroup.procs'), 'r') as f:
-                                               return f.read().split()
+                                               return [int(p) for p in f.read().split()]
                                except OSError:
                                        # cgroup removed already?
                                        return []
@@ -198,7 +198,7 @@ class SpawnProcess(SubProcess):
                        def kill_all(pids, sig):
                                for p in pids:
                                        try:
-                                               os.kill(int(p), sig)
+                                               os.kill(p, sig)
                                        except OSError as e:
                                                if e.errno == errno.EPERM:
                                                        # Reported with hardened kernel (bug #358211).