2626
2727from jinja2 import Template
2828
29- from tornado import gen
30-
3129from jupyterhub .spawner import Spawner
3230from traitlets import Integer , Unicode , Float , Dict , default
3331
@@ -448,11 +446,11 @@ async def start(self):
448446 " while pending in the queue or died immediately"
449447 " after starting."
450448 )
451- await gen .sleep (self .startup_poll_interval )
449+ await asyncio .sleep (self .startup_poll_interval )
452450
453451 self .ip = self .state_gethost ()
454452 while self .port == 0 :
455- await gen .sleep (self .startup_poll_interval )
453+ await asyncio .sleep (self .startup_poll_interval )
456454 # Test framework: For testing, mock_port is set because we
457455 # don't actually run the single-user server yet.
458456 if hasattr (self , "mock_port" ):
@@ -481,7 +479,7 @@ async def stop(self, now=False):
481479 status = await self .query_job_status ()
482480 if status not in (JobStatus .RUNNING , JobStatus .UNKNOWN ):
483481 return
484- await gen .sleep (1.0 )
482+ await asyncio .sleep (1 )
485483 if self .job_id :
486484 self .log .warning (
487485 "Notebook server job {0} at {1}:{2} possibly failed to terminate" .format (
@@ -498,7 +496,7 @@ async def progress(self):
498496 return
499497 else :
500498 yield {"message" : "Unknown status..." }
501- await gen .sleep (1 )
499+ await asyncio .sleep (1 )
502500
503501
504502class BatchSpawnerRegexStates (BatchSpawnerBase ):
0 commit comments