diff options
author | Jan Tattermusch <jtattermusch@google.com> | 2015-09-21 09:30:49 -0700 |
---|---|---|
committer | Jan Tattermusch <jtattermusch@google.com> | 2015-09-21 09:30:49 -0700 |
commit | 13e65dfd4f5a61d453dc42f0a0e8b1bf1885fbcb (patch) | |
tree | bb1cb11c0d40e3de7eebc5192d41f341961bf8fc | |
parent | 5896984558d764ce4accee81306a5bb7e3016bc5 (diff) |
import yaml module lazily
-rwxr-xr-x | tools/run_tests/port_server.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/run_tests/port_server.py b/tools/run_tests/port_server.py index d14c829fe0..acb6deaae6 100755 --- a/tools/run_tests/port_server.py +++ b/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() |