fix readability-braces-around-statements

This commit is contained in:
wmayer
2023-11-14 22:29:28 +01:00
parent 0633129b83
commit c5f5bfd22a
4 changed files with 198 additions and 97 deletions

View File

@@ -511,8 +511,9 @@ inline PyObject * PyAsUnicodeObject(const char *str)
// Returns a new reference, don't increment it!
Py_ssize_t len = Py_SAFE_DOWNCAST(strlen(str), size_t, Py_ssize_t);
PyObject *p = PyUnicode_DecodeUTF8(str, len, nullptr);
if (!p)
if (!p) {
throw Base::UnicodeError("UTF8 conversion failure at PyAsUnicodeString()");
}
return p;
}
@@ -547,8 +548,9 @@ inline void PyTypeCheck(PyObject** ptr, int (*method)(PyObject*), const char* ms
*ptr = nullptr;
return;
}
if (!method(*ptr))
if (!method(*ptr)) {
throw Base::TypeError(msg);
}
}