Skip to content

Commit 0a62e5d

Browse files
susmitsusmit
authored andcommitted
Code Refactored
1 parent 219a122 commit 0a62e5d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎py_ext/tlshmodule.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -381,20 +381,20 @@ Tlsh_fromTlshStr(tlsh_TlshObject *self, PyObject *args)
381381
arg = asciiStr;
382382
#else
383383
if (!PyString_Check(arg)) {
384-
PyErr_SetString(PyExc_ValueError, "argument is not a TLSH hex string");
385-
return NULL;
384+
PyErr_SetString(PyExc_ValueError, "argument is not a TLSH hex string");
385+
return NULL;
386386
}
387387
#endif
388388

389389
if (PyBytes_AsStringAndSize(arg, &str, &len) == -1) {
390-
PyErr_SetString(PyExc_ValueError, "failed to extract string and size");
390+
PyErr_SetString(PyExc_ValueError, "argument is not a TLSH hex string");
391391
#if PY_MAJOR_VERSION >= 3
392392
Py_XDECREF(asciiStr);
393393
#endif
394394
return NULL;
395395
}
396396

397-
if ((len != TLSH_STRING_LEN_REQ) && (len != TLSH_STRING_LEN_REQ - 2)) {
397+
if ((len != TLSH_STRING_LEN_REQ) && (len != TLSH_STRING_LEN_REQ-2)) {
398398
PyErr_SetString(PyExc_ValueError, "argument length incorrect: not a TLSH hex string");
399399
#if PY_MAJOR_VERSION >= 3
400400
Py_XDECREF(asciiStr);

0 commit comments

Comments
 (0)