This is an archive of the discontinued Mercurial Phabricator instance.

pathencode: fix importing hashlib on Python 3
ClosedPublic

Authored by durin42 on May 18 2018, 8:51 PM.

Details

Summary

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.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

durin42 created this revision.May 18 2018, 8:51 PM
yuja added a subscriber: yuja.May 18 2018, 10:35 PM

Queued, thanks.

		if (name == NULL)
			return -1;
  • hashlib = PyImport_Import(name);

+ hashlib = PyImport_ImportModule("hashlib");

		Py_DECREF(name);

Nit: name is no longer used.

This revision was automatically updated to reflect the committed changes.