# HG changeset patch # User Gregory Szorc # Date 2015-12-07 06:20:08 # Node ID faca4adfed0af3611d76fbacc854e3fbdc5e1b1c # Parent 5defcb7d6e5f6b6a32425d8c96356e46b87bd0ab tests: use absolute_import in tinyproxy Thus begins a series of adding absolute_import to a bunch of files for Python 3 compatibility. diff --git a/tests/test-check-py3-compat.t b/tests/test-check-py3-compat.t --- a/tests/test-check-py3-compat.t +++ b/tests/test-check-py3-compat.t @@ -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 diff --git a/tests/tinyproxy.py b/tests/tinyproxy.py --- a/tests/tinyproxy.py +++ b/tests/tinyproxy.py @@ -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 @@ Any help will be greatly appreciated. __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