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.
Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHG92ac9cf78dba: pathencode: fix importing hashlib on Python 3
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Comment Actions
Queued, thanks.
if (name == NULL) return -1;
- hashlib = PyImport_Import(name);
+ hashlib = PyImport_ImportModule("hashlib");
Py_DECREF(name);
Nit: name is no longer used.