Patchwork D3587: pathencode: fix importing hashlib on Python 3

login
register
mail settings
Submitter phabricator
Date May 19, 2018, 2:37 a.m.
Message ID <578ff0189de187ed4a4953ed5201a7a8@localhost.localdomain>
Download mbox | patch
Permalink /patch/31672/
State Not Applicable
Headers show

Comments

phabricator - May 19, 2018, 2:37 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG92ac9cf78dba: pathencode: fix importing hashlib on Python 3 (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3587?vs=8749&id=8758

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

AFFECTED FILES
  mercurial/cext/pathencode.c

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: yuja, mercurial-devel

Patch

diff --git a/mercurial/cext/pathencode.c b/mercurial/cext/pathencode.c
--- a/mercurial/cext/pathencode.c
+++ b/mercurial/cext/pathencode.c
@@ -660,7 +660,7 @@ 
 		if (name == NULL)
 			return -1;
 
-		hashlib = PyImport_Import(name);
+		hashlib = PyImport_ImportModule("hashlib");
 		Py_DECREF(name);
 
 		if (hashlib == NULL) {