From patchwork Sun Dec 4 14:00:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [3,of,3] py3: use pycompat.sysstr() in __import__() From: Pulkit Goyal <7895pulkit@gmail.com> X-Patchwork-Id: 17818 Message-Id: <93275b09d8977ad5700c.1480860052@pulkit-goyal> To: mercurial-devel@mercurial-scm.org Date: Sun, 04 Dec 2016 19:30:52 +0530 # HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1480578124 -19800 # Thu Dec 01 13:12:04 2016 +0530 # Node ID 93275b09d8977ad5700ca56a017f48ce602058ba # Parent 3743d04e0403e49cd5a9c00d753262162712eeab py3: use pycompat.sysstr() in __import__() __import__() on Python 3 accepts strings which are different from that of Python 2. Used pycompat.sysstr() to get string accordingly. diff -r 3743d04e0403 -r 93275b09d897 mercurial/extensions.py --- a/mercurial/extensions.py Wed Nov 30 23:51:11 2016 +0530 +++ b/mercurial/extensions.py Thu Dec 01 13:12:04 2016 +0530 @@ -18,6 +18,7 @@ from . import ( cmdutil, error, + pycompat, util, ) @@ -74,7 +75,7 @@ def _importh(name): """import and return the module""" - mod = __import__(name) + mod = __import__(pycompat.sysstr(name)) components = name.split('.') for comp in components[1:]: mod = getattr(mod, comp)