changeset 27302:faca4adfed0a

tests: use absolute_import in tinyproxy Thus begins a series of adding absolute_import to a bunch of files for Python 3 compatibility.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 06 Dec 2015 22:20:08 -0800
parents 5defcb7d6e5f
children 57bd9c5431a5
files tests/test-check-py3-compat.t tests/tinyproxy.py
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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