Show More
@@ -653,24 +653,24 b' static int sha1hash(char hash[20], const' | |||
|
653 | 653 | PyObject *shaobj, *hashobj; |
|
654 | 654 | |
|
655 | 655 | if (shafunc == NULL) { |
|
656 |
PyObject * |
|
|
656 | PyObject *hashlib, *name = PyString_FromString("hashlib"); | |
|
657 | 657 | |
|
658 | 658 | if (name == NULL) |
|
659 | 659 | return -1; |
|
660 | 660 | |
|
661 |
|
|
|
661 | hashlib = PyImport_Import(name); | |
|
662 | 662 | Py_DECREF(name); |
|
663 | 663 | |
|
664 |
if ( |
|
|
665 |
PyErr_SetString(PyExc_ImportError, " |
|
|
664 | if (hashlib == NULL) { | |
|
665 | PyErr_SetString(PyExc_ImportError, "hashlib"); | |
|
666 | 666 | return -1; |
|
667 | 667 | } |
|
668 |
shafunc = PyObject_GetAttrString( |
|
|
669 |
Py_DECREF( |
|
|
668 | shafunc = PyObject_GetAttrString(hashlib, "sha1"); | |
|
669 | Py_DECREF(hashlib); | |
|
670 | 670 | |
|
671 | 671 | if (shafunc == NULL) { |
|
672 | 672 | PyErr_SetString(PyExc_AttributeError, |
|
673 |
"module ' |
|
|
673 | "module 'hashlib' has no " | |
|
674 | 674 | "attribute 'sha1'"); |
|
675 | 675 | return -1; |
|
676 | 676 | } |
General Comments 0
You need to be logged in to leave comments.
Login now