Patchwork D3589: pathencode: improve error messages slightly

login
register
mail settings
Submitter phabricator
Date May 19, 2018, 2:37 a.m.
Message ID <d24cc8806d572f1b26cb8f94118b3434@localhost.localdomain>
Download mbox | patch
Permalink /patch/31676/
State Not Applicable
Headers show

Comments

phabricator - May 19, 2018, 2:37 a.m.
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




To: durin42, #hg-reviewers
Cc: mercurial-devel

Patch

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;
 		}
 	}