[PATCH 8 of 8] tests/tinyproxy: use absolute_import

Augie Fackler raf at durin42.com
Tue Dec 8 09:43:01 CST 2015


On Mon, Dec 07, 2015 at 10:35:08PM -0500, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc at gmail.com>
> # Date 1449469208 28800
> #      Sun Dec 06 22:20:08 2015 -0800
> # Node ID e90d5745a1358e7da42c934cf0a840df1901699f
> # Parent  4bd8525de68c587b1385da318370e61b310bc3e1
> tests/tinyproxy: use absolute_import

Queued these, thanks.

>
> 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
> @@ -219,6 +219,5 @@
>    tests/test-url.py not using absolute_import
>    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,6 +1,8 @@
>  #!/usr/bin/env python
>
> +from __future__ import absolute_import
> +
>  __doc__ = """Tiny HTTP Proxy.
>
>  This module implements GET, HEAD, POST, PUT and DELETE methods
>  on BaseHTTPServer, and behaves as an HTTP proxy.  The CONNECT
> @@ -11,9 +13,14 @@ 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
>      __base_handle = __base.handle
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list