import yaml module lazily

pull/3392/head
Jan Tattermusch 9 years ago
parent 5896984558
commit 13e65dfd4f
  1. 4
      tools/run_tests/port_server.py

@ -37,7 +37,6 @@ import os
import socket
import sys
import time
import yaml
argp = argparse.ArgumentParser(description='Server for httpcli_test')
argp.add_argument('-p', '--port', default=12345, type=int)
@ -118,6 +117,9 @@ class Handler(BaseHTTPServer.BaseHTTPRequestHandler):
self.end_headers()
self.wfile.write(_MY_VERSION)
elif self.path == '/dump':
# yaml module is not installed on Macs and Windows machines by default
# so we import it lazily (/dump action is only used for debugging)
import yaml
self.send_response(200)
self.send_header('Content-Type', 'text/plain')
self.end_headers()

Loading…
Cancel
Save