Patchwork fix_bytesmod: use the "from mercurial" form of the import to avoid breaking httpclient

login
register
mail settings
Submitter Augie Fackler
Date March 13, 2014, 4:26 p.m.
Message ID <2d2c95082bc66e474f89.1394728010@augie-macbookair>
Download mbox | patch
Permalink /patch/3937/
State Accepted
Commit d20817ac628a22ff5f3adf2551c33203a9b01eb7
Headers show

Comments

Augie Fackler - March 13, 2014, 4:26 p.m.
# HG changeset patch
# User Augie Fackler <raf@durin42.com>
# Date 1391556805 18000
#      Tue Feb 04 18:33:25 2014 -0500
# Node ID 2d2c95082bc66e474f891bcfce6219d9b08ab6e3
# Parent  1cd5bff45db28150d7c140be493fe851e6560f27
fix_bytesmod: use the "from mercurial" form of the import to avoid breaking httpclient

Without this patch, 2to3's rewrites to httpclient cause it to fail to
import. With this patch, it's probably hopelessly broken, but at least
won't block forward progress on non-http2 functionality on Python 3.
Matt Mackall - March 13, 2014, 5:03 p.m.
On Thu, 2014-03-13 at 12:26 -0400, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler <raf@durin42.com>
> # Date 1391556805 18000
> #      Tue Feb 04 18:33:25 2014 -0500
> # Node ID 2d2c95082bc66e474f891bcfce6219d9b08ab6e3
> # Parent  1cd5bff45db28150d7c140be493fe851e6560f27
> fix_bytesmod: use the "from mercurial" form of the import to avoid breaking httpclient

Queued for default, thanks.

Patch

diff --git a/contrib/hgfixes/fix_bytesmod.py b/contrib/hgfixes/fix_bytesmod.py
--- a/contrib/hgfixes/fix_bytesmod.py
+++ b/contrib/hgfixes/fix_bytesmod.py
@@ -37,7 +37,7 @@ 
             if self.filename.endswith(bfn):
                 return
         if not self.filename.endswith('mercurial/py3kcompat.py'):
-            touch_import('.', 'py3kcompat', node=node)
+            touch_import('mercurial', 'py3kcompat', node=node)
 
         formatstr = results['formatstr'].clone()
         data = results['data'].clone()