[PATCH] fix_bytesmod: use the "from mercurial" form of the import to avoid breaking httpclient

Augie Fackler raf at durin42.com
Thu Mar 13 11:26:50 CDT 2014


# HG changeset patch
# User Augie Fackler <raf at 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.

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()


More information about the Mercurial-devel mailing list