D3589: pathencode: improve error messages slightly
This revision was automatically updated to reflect the committed changes. Closed by commit rHG9aaa74f9eb87: pathencode: improve error messages slightly (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3589?vs=8751&id=8760 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 ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3589: pathencode: improve error messages slightly
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 ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel