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

login
register
mail settings
Submitter Yuya Nishihara
Date April 4, 2016, 3:07 p.m.
Message ID <2f683be2ecc2c168da03.1459782461@mimosa>
Download mbox | patch
Permalink /patch/14353/
State Accepted
Delegated to: Martin von Zweigbergk
Headers show

Comments

Yuya Nishihara - April 4, 2016, 3:07 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@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

Patch

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: