[PATCH 21 of 21 WIP-PY3K] url: use urllib2, httplib and StringIO from py3kcompat

Matthew Turk matthewturk at gmail.com
Mon Oct 12 16:25:05 CDT 2015


# HG changeset patch
# User Matthew Turk <matthewturk at gmail.com>
# Date 1444684481 18000
#      Mon Oct 12 16:14:41 2015 -0500
# Node ID 4cf212eac1b56b5fe70c142cba87911e4120d346
# Parent  59d00201f929e4296aada21845999bd9669a211e
url: use urllib2, httplib and StringIO from py3kcompat

diff -r 59d00201f929 -r 4cf212eac1b5 mercurial/url.py
--- a/mercurial/url.py	Mon Oct 12 16:13:33 2015 -0500
+++ b/mercurial/url.py	Mon Oct 12 16:14:41 2015 -0500
@@ -10,12 +10,14 @@
 from __future__ import absolute_import
 
 import base64
-import cStringIO
-import httplib
 import os
 import socket
-import urllib
-import urllib2
+from .py3kcompat import (
+    httplib,
+    urllib2,
+    pathname2url,
+    StringIO
+)
 
 from .i18n import _
 from . import (
@@ -273,7 +275,7 @@
         res.length = None
         res.chunked = 0
         res.will_close = 1
-        res.msg = httplib.HTTPMessage(cStringIO.StringIO())
+        res.msg = httplib.HTTPMessage(StringIO())
         return False
 
     res.msg = httplib.HTTPMessage(res.fp)


More information about the Mercurial-devel mailing list