changeset 38113:f7a0398996ad

pathencode: remove unused variable Caught by Yuya during review of 92ac9cf78dba. Differential Revision: https://phab.mercurial-scm.org/D3618
author Augie Fackler <augie@google.com>
date Sat, 19 May 2018 14:24:36 -0400
parents d7cecea0b254
children f79ba1d1b4b1
files mercurial/cext/pathencode.c
diffstat 1 files changed, 1 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cext/pathencode.c	Sun May 20 18:41:24 2018 +0530
+++ b/mercurial/cext/pathencode.c	Sat May 19 14:24:36 2018 -0400
@@ -655,14 +655,7 @@
 	PyObject *shaobj, *hashobj;
 
 	if (shafunc == NULL) {
-		PyObject *hashlib, *name = PyBytes_FromString("hashlib");
-
-		if (name == NULL)
-			return -1;
-
-		hashlib = PyImport_ImportModule("hashlib");
-		Py_DECREF(name);
-
+		PyObject *hashlib = PyImport_ImportModule("hashlib");
 		if (hashlib == NULL) {
 			PyErr_SetString(PyExc_ImportError,
 			                "pathencode failed to find hashlib");