Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/debugcommands.py @ 31091:2912b06905dc
py3: use pycompat.fsencode() to convert __file__ to bytes
__file__ returns unicodes on Python 3. This patch uses pycompat.fsencode() to
convert them to bytes.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Mon, 20 Feb 2017 18:40:42 +0530 |
parents | 0b8356705de6 |
children | c4e8fa2b1c40 |
comparison
equal
deleted
inserted
replaced
31090:2cf1e5207fdf | 31091:2912b06905dc |
---|---|
690 exts = extensions.extensions(ui) | 690 exts = extensions.extensions(ui) |
691 hgver = util.version() | 691 hgver = util.version() |
692 fm = ui.formatter('debugextensions', opts) | 692 fm = ui.formatter('debugextensions', opts) |
693 for extname, extmod in sorted(exts, key=operator.itemgetter(0)): | 693 for extname, extmod in sorted(exts, key=operator.itemgetter(0)): |
694 isinternal = extensions.ismoduleinternal(extmod) | 694 isinternal = extensions.ismoduleinternal(extmod) |
695 extsource = extmod.__file__ | 695 extsource = pycompat.fsencode(extmod.__file__) |
696 if isinternal: | 696 if isinternal: |
697 exttestedwith = [] # never expose magic string to users | 697 exttestedwith = [] # never expose magic string to users |
698 else: | 698 else: |
699 exttestedwith = getattr(extmod, 'testedwith', '').split() | 699 exttestedwith = getattr(extmod, 'testedwith', '').split() |
700 extbuglink = getattr(extmod, 'buglink', None) | 700 extbuglink = getattr(extmod, 'buglink', None) |
968 | 968 |
969 # compiled modules | 969 # compiled modules |
970 fm.write('hgmodulepolicy', _("checking module policy (%s)\n"), | 970 fm.write('hgmodulepolicy', _("checking module policy (%s)\n"), |
971 policy.policy) | 971 policy.policy) |
972 fm.write('hgmodules', _("checking installed modules (%s)...\n"), | 972 fm.write('hgmodules', _("checking installed modules (%s)...\n"), |
973 os.path.dirname(__file__)) | 973 os.path.dirname(pycompat.fsencode(__file__))) |
974 | 974 |
975 err = None | 975 err = None |
976 try: | 976 try: |
977 from . import ( | 977 from . import ( |
978 base85, | 978 base85, |