D2154: py3: use system strings when calling __import__

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Mon Feb 12 21:47:22 EST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHGc4146cf4dd20: py3: use system strings when calling __import__ (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2154?vs=5455&id=5579

REVISION DETAIL
  https://phab.mercurial-scm.org/D2154

AFFECTED FILES
  mercurial/hook.py

CHANGE DETAILS

diff --git a/mercurial/hook.py b/mercurial/hook.py
--- a/mercurial/hook.py
+++ b/mercurial/hook.py
@@ -49,12 +49,12 @@
                 modname = modfile
         with demandimport.deactivated():
             try:
-                obj = __import__(modname)
+                obj = __import__(pycompat.sysstr(modname))
             except (ImportError, SyntaxError):
                 e1 = sys.exc_info()
                 try:
                     # extensions are loaded with hgext_ prefix
-                    obj = __import__("hgext_%s" % modname)
+                    obj = __import__(r"hgext_%s" % pycompat.sysstr(modname))
                 except (ImportError, SyntaxError):
                     e2 = sys.exc_info()
                     if ui.tracebackflag:



To: indygreg, #hg-reviewers, pulkit, durin42
Cc: mercurial-devel


More information about the Mercurial-devel mailing list