mirror of
https://github.com/denoland/deno.git
synced 2025-01-18 03:44:05 -05:00
Interrupt http_server.py by ctrl + c (#1001)
This commit is contained in:
parent
c61a0f2f84
commit
a90cf4c2ee
1 changed files with 6 additions and 2 deletions
|
@ -2,6 +2,7 @@
|
|||
# Many tests expect there to be an http server on port 4545 servering the deno
|
||||
# root directory.
|
||||
import os
|
||||
import sys
|
||||
from threading import Thread
|
||||
import SimpleHTTPServer
|
||||
import SocketServer
|
||||
|
@ -51,8 +52,11 @@ def spawn():
|
|||
r_thread.daemon = True
|
||||
r_thread.start()
|
||||
sleep(1) # TODO I'm too lazy to figure out how to do this properly.
|
||||
return thread
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
spawn().join()
|
||||
try:
|
||||
spawn()
|
||||
while True: sleep(100)
|
||||
except KeyboardInterrupt:
|
||||
sys.exit()
|
||||
|
|
Loading…
Add table
Reference in a new issue