changeset 38087:92ac9cf78dba

pathencode: fix importing hashlib on Python 3 I'm curious why PyImport_Import is returning NULL, but PyImport_ImportModule bypasses some of the regular import path, probably including demandimport, which I suspect is the issue here. Differential Revision: https://phab.mercurial-scm.org/D3587
author Augie Fackler <augie@google.com>
date Fri, 18 May 2018 20:42:04 -0400
parents c0f8fa74d8c2
children 4fccc73ce2f6
files mercurial/cext/pathencode.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cext/pathencode.c	Fri May 18 20:11:24 2018 -0400
+++ b/mercurial/cext/pathencode.c	Fri May 18 20:42:04 2018 -0400
@@ -660,7 +660,7 @@
 		if (name == NULL)
 			return -1;
 
-		hashlib = PyImport_Import(name);
+		hashlib = PyImport_ImportModule("hashlib");
 		Py_DECREF(name);
 
 		if (hashlib == NULL) {