Show pid when starting simple server.

This commit is contained in:
voussoir 2021-09-30 14:27:25 -07:00
parent cecb1efc4b
commit a7bedb139d
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -323,7 +323,7 @@ class SimpleServer:
def start(self): def start(self):
server = http.server.ThreadingHTTPServer(('0.0.0.0', self.port), self.make_request_handler) server = http.server.ThreadingHTTPServer(('0.0.0.0', self.port), self.make_request_handler)
print(f'Server starting on {self.port}') print(f'Server starting on {self.port}, pid={os.getpid()}.')
try: try:
server.serve_forever() server.serve_forever()
except KeyboardInterrupt: except KeyboardInterrupt: