File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -234,17 +234,14 @@ def _cpus(cls):
234234 # - cgroupsv1: /cpuset.cpus
235235 # - cgroupsv2: /cpuset.cpus.effective
236236 # For more details, see https://docs.kernel.org/admin-guide/cgroup-v2.html#cpuset-interface-files
237- cpulist = None
238237 for path in [
239238 Path ("/sys/fs/cgroup/cpuset/cpuset.cpus" ),
240239 Path ("/sys/fs/cgroup/cpuset.cpus.effective" ),
241240 ]:
242241 if path .exists ():
243- cpulist = path .read_text ("ascii" ).strip ()
244- break
245- else :
246- raise RuntimeError ("Could not find cgroups cpuset" )
247- return ListFormatParser (cpulist ).parse ()
242+ return ListFormatParser (path .read_text ("ascii" ).strip ()).parse ()
243+
244+ raise RuntimeError ("Could not find cgroups cpuset" )
248245
249246
250247class ListFormatParser :
You can’t perform that action at this time.
0 commit comments