[PATCH 8 of 9] tests: make tinyproxy.py not import sys.argv by name

Yuya Nishihara yuya at tcha.org
Mon Apr 4 11:07:41 EDT 2016


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1459681979 -32400
#      Sun Apr 03 20:12:59 2016 +0900
# Node ID 2f683be2ecc2c168da0323391418749ff90c3155
# Parent  8ee664af1cc683f97610be6fe1be9eca513929f0
tests: make tinyproxy.py not import sys.argv by name

diff --git a/tests/tinyproxy.py b/tests/tinyproxy.py
--- a/tests/tinyproxy.py
+++ b/tests/tinyproxy.py
@@ -19,6 +19,7 @@ import SocketServer
 import os
 import select
 import socket
+import sys
 import urlparse
 
 class ProxyHandler (BaseHTTPServer.BaseHTTPRequestHandler):
@@ -140,7 +141,7 @@ class ThreadingHTTPServer (SocketServer.
         a.close()
 
 if __name__ == '__main__':
-    from sys import argv
+    argv = sys.argv
     if argv[1:] and argv[1] in ('-h', '--help'):
         print(argv[0], "[port [allowed_client_name ...]]")
     else:


More information about the Mercurial-devel mailing list