D3589: pathencode: improve error messages slightly
durin42 (Augie Fackler)
phabricator at mercurial-scm.org
Sat May 19 00:52:03 UTC 2018
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
Both of these are conditions we should never hit, so we can afford to
be more verbose to make debugging less baffling.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D3589
AFFECTED FILES
mercurial/cext/pathencode.c
CHANGE DETAILS
diff --git a/mercurial/cext/pathencode.c b/mercurial/cext/pathencode.c
--- a/mercurial/cext/pathencode.c
+++ b/mercurial/cext/pathencode.c
@@ -664,16 +664,17 @@
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");
Py_DECREF(hashlib);
if (shafunc == NULL) {
PyErr_SetString(PyExc_AttributeError,
"module 'hashlib' has no "
- "attribute 'sha1'");
+ "attribute 'sha1' in pathencode");
return -1;
}
}
To: durin42, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list