pathencode: improve error messages slightly
Both of these are conditions we should never hit, so we can afford to
be more verbose to make debugging less baffling.
Differential Revision: https://phab.mercurial-scm.org/D3589
--- a/mercurial/cext/pathencode.c Fri May 18 20:42:31 2018 -0400
+++ b/mercurial/cext/pathencode.c Fri May 18 20:43:01 2018 -0400
@@ -664,7 +664,8 @@
Py_DECREF(name);
if (hashlib == NULL) {
- PyErr_SetString(PyExc_ImportError, "hashlib");
+ PyErr_SetString(PyExc_ImportError,
+ "pathencode failed to find hashlib");
return -1;
}
shafunc = PyObject_GetAttrString(hashlib, "sha1");
@@ -673,7 +674,7 @@
if (shafunc == NULL) {
PyErr_SetString(PyExc_AttributeError,
"module 'hashlib' has no "
- "attribute 'sha1'");
+ "attribute 'sha1' in pathencode");
return -1;
}
}