comparison contrib/hgfixes/fix_bytesmod.py @ 20701:d20817ac628a

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.
author Augie Fackler <raf@durin42.com>
date Tue, 04 Feb 2014 18:33:25 -0500
parents 74daabdf5ab5
children
comparison
equal deleted inserted replaced
20698:1147563faf62 20701:d20817ac628a
35 def transform(self, node, results): 35 def transform(self, node, results):
36 for bfn in blacklist: 36 for bfn in blacklist:
37 if self.filename.endswith(bfn): 37 if self.filename.endswith(bfn):
38 return 38 return
39 if not self.filename.endswith('mercurial/py3kcompat.py'): 39 if not self.filename.endswith('mercurial/py3kcompat.py'):
40 touch_import('.', 'py3kcompat', node=node) 40 touch_import('mercurial', 'py3kcompat', node=node)
41 41
42 formatstr = results['formatstr'].clone() 42 formatstr = results['formatstr'].clone()
43 data = results['data'].clone() 43 data = results['data'].clone()
44 formatstr.prefix = '' # remove spaces from start 44 formatstr.prefix = '' # remove spaces from start
45 45