#NEWLINE# def start_server( handler ) : #NEWLINE# #INDENT# httpd = ShutdownServer ( ( '' , 0 ) , handler ) #NEWLINE# threading . Thread ( target = httpd . serve_forever ) . start ( ) #NEWLINE# ( _ , port ) = httpd . socket . getsockname ( ) #NEWLINE# return ( httpd , port )