tests: use absolute_import in tinyproxy
authorGregory Szorc <gregory.szorc@gmail.com>
Sun, 06 Dec 2015 22:20:08 -0800
changeset 27302 faca4adfed0a
parent 27301 5defcb7d6e5f
child 27303 57bd9c5431a5
tests: use absolute_import in tinyproxy Thus begins a series of adding absolute_import to a bunch of files for Python 3 compatibility.
tests/test-check-py3-compat.t
tests/tinyproxy.py
--- a/tests/test-check-py3-compat.t	Sun Dec 06 22:02:39 2015 -0800
+++ b/tests/test-check-py3-compat.t	Sun Dec 06 22:20:08 2015 -0800
@@ -220,5 +220,4 @@
   tests/test-url.py requires print_function
   tests/test-walkrepo.py requires print_function
   tests/test-wireproto.py requires print_function
-  tests/tinyproxy.py not using absolute_import
   tests/tinyproxy.py requires print_function
--- a/tests/tinyproxy.py	Sun Dec 06 22:02:39 2015 -0800
+++ b/tests/tinyproxy.py	Sun Dec 06 22:20:08 2015 -0800
@@ -1,5 +1,7 @@
 #!/usr/bin/env python
 
+from __future__ import absolute_import
+
 __doc__ = """Tiny HTTP Proxy.
 
 This module implements GET, HEAD, POST, PUT and DELETE methods
@@ -12,7 +14,12 @@
 
 __version__ = "0.2.1"
 
-import BaseHTTPServer, select, socket, SocketServer, urlparse, os
+import BaseHTTPServer
+import os
+import select
+import socket
+import SocketServer
+import urlparse
 
 class ProxyHandler (BaseHTTPServer.BaseHTTPRequestHandler):
     __base = BaseHTTPServer.BaseHTTPRequestHandler