Skip to content

Commit 699a417

Browse files
authored
Merge pull request #224 from jasongrout/lock
Use the recommended async with syntax to acquire and release an asyncio Lock
2 parents 87a3550 + 534b439 commit 699a417

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

jupyter_server_proxy/handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ async def ensure_process(self):
491491
# FIXME: Make sure this times out properly?
492492
# Invariant here should be: when lock isn't being held, either 'proc' is in state &
493493
# running, or not.
494-
with (await self.state['proc_lock']):
494+
async with self.state['proc_lock']:
495495
if 'proc' not in self.state:
496496
# FIXME: Prevent races here
497497
# FIXME: Handle graceful exits of spawned processes here

0 commit comments

Comments
 (0)