1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 02:00:45 +00:00

Merge pull request #53 from mdigiorgio/fix-cgroups_get_states

cgroups: fix get_states() return value when passing integer state
This commit is contained in:
setrofim 2016-08-01 10:46:24 +01:00 committed by GitHub
commit b9a16982d8

View File

@ -113,7 +113,7 @@ class Cpuidle(Module):
def get_state(self, state, cpu=0): def get_state(self, state, cpu=0):
if isinstance(state, int): if isinstance(state, int):
try: try:
self.get_states(cpu)[state].enable() return self.get_states(cpu)[state]
except IndexError: except IndexError:
raise ValueError('Cpuidle state {} does not exist'.format(state)) raise ValueError('Cpuidle state {} does not exist'.format(state))
else: # assume string-like else: # assume string-like