Skip to content

Commit

Permalink
Remove unnecssary is None checks
Browse files Browse the repository at this point in the history
  • Loading branch information
rcschrg committed Mar 11, 2024
1 parent 760d01b commit 9da486b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions mango/util/scheduling.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ def suspend(self, given_src):
if src == given_src and coro is not None:
coro.suspend()
for _, _, event, src in self._scheduled_process_tasks:
if src == given_src and event[0] is not None:
if src == given_src:
event[0].clear()

def resume(self, given_src):
Expand All @@ -803,7 +803,7 @@ def resume(self, given_src):
if src == given_src and coro is not None:
coro.resume()
for _, _, event, src in self._scheduled_process_tasks:
if src == given_src and event[0] is not None:
if src == given_src:
event[0].set()

def _remove_process_task(self, fut=asyncio.Future):
Expand Down Expand Up @@ -877,8 +877,7 @@ async def shutdown(self):
"""
# resume all process so they can get shutdown
for _, _, event, _ in self._scheduled_process_tasks:
if event[1] is not None:
event[1].set()
event[1].set()
for task, _, _, _ in self._scheduled_tasks:
task.close()
await self.stop()
Expand Down

0 comments on commit 9da486b

Please sign in to comment.