# HG changeset patch # User Augie Fackler # Date 2018-05-19 18:24:36 # Node ID f7a0398996ad26e47bf4c598692f8cf349c82401 # Parent d7cecea0b2546764ca12f5e39394d851ab171076 pathencode: remove unused variable Caught by Yuya during review of 92ac9cf78dba. Differential Revision: https://phab.mercurial-scm.org/D3618 diff --git a/mercurial/cext/pathencode.c b/mercurial/cext/pathencode.c --- a/mercurial/cext/pathencode.c +++ b/mercurial/cext/pathencode.c @@ -655,14 +655,7 @@ static int sha1hash(char hash[20], const 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");