equal
deleted
inserted
replaced
653 { |
653 { |
654 static PyObject *shafunc; |
654 static PyObject *shafunc; |
655 PyObject *shaobj, *hashobj; |
655 PyObject *shaobj, *hashobj; |
656 |
656 |
657 if (shafunc == NULL) { |
657 if (shafunc == NULL) { |
658 PyObject *hashlib, *name = PyBytes_FromString("hashlib"); |
658 PyObject *hashlib = PyImport_ImportModule("hashlib"); |
659 |
|
660 if (name == NULL) |
|
661 return -1; |
|
662 |
|
663 hashlib = PyImport_ImportModule("hashlib"); |
|
664 Py_DECREF(name); |
|
665 |
|
666 if (hashlib == NULL) { |
659 if (hashlib == NULL) { |
667 PyErr_SetString(PyExc_ImportError, |
660 PyErr_SetString(PyExc_ImportError, |
668 "pathencode failed to find hashlib"); |
661 "pathencode failed to find hashlib"); |
669 return -1; |
662 return -1; |
670 } |
663 } |