Skip to content

Commit b2b2823

Browse files
committed
Minor refactor
1 parent 2e77555 commit b2b2823

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

sleep_inhibitor.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,21 +98,21 @@ async def run(self):
9898
'Worker function which runs as a asyncio task for each plugin'
9999
while True:
100100
proc = await asyncio.create_subprocess_exec(*self.cmd)
101-
await proc.wait()
101+
return_code = await proc.wait()
102102

103-
while proc.returncode == SUSP_CODE:
103+
while return_code == SUSP_CODE:
104104
if self.is_inhibiting is not True:
105105
self.is_inhibiting = True
106106
print(f'{self.name} is inhibiting '
107-
f'suspend (return={proc.returncode})')
107+
f'suspend (return={return_code})')
108108

109109
proc = await asyncio.create_subprocess_exec(*self.icmd)
110-
await proc.wait()
110+
return_code = await proc.wait()
111111

112112
if self.is_inhibiting is not False:
113113
self.is_inhibiting = False
114114
print(f'{self.name} is not inhibiting '
115-
f'suspend (return={proc.returncode})')
115+
f'suspend (return={return_code})')
116116

117117
await asyncio.sleep(self.period)
118118

0 commit comments

Comments
 (0)