comparison mercurial/extensions.py @ 31074: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 5ffbaba9acac
children d79761fe697f
comparison
equal deleted inserted replaced
31073:2cf1e5207fdf 31074:2912b06905dc
360 360
361 def _disabledpaths(strip_init=False): 361 def _disabledpaths(strip_init=False):
362 '''find paths of disabled extensions. returns a dict of {name: path} 362 '''find paths of disabled extensions. returns a dict of {name: path}
363 removes /__init__.py from packages if strip_init is True''' 363 removes /__init__.py from packages if strip_init is True'''
364 import hgext 364 import hgext
365 extpath = os.path.dirname(os.path.abspath(hgext.__file__)) 365 extpath = os.path.dirname(
366 os.path.abspath(pycompat.fsencode(hgext.__file__)))
366 try: # might not be a filesystem path 367 try: # might not be a filesystem path
367 files = os.listdir(extpath) 368 files = os.listdir(extpath)
368 except OSError: 369 except OSError:
369 return {} 370 return {}
370 371