sys: Improved ScopeGuard syntax a lot

This commit is contained in:
WerWolv
2021-03-31 22:54:43 +02:00
parent a2c80e3fd6
commit 2f19ff768d
8 changed files with 70 additions and 50 deletions

View File

@@ -79,7 +79,7 @@ namespace hex {
return nullptr;
}
SCOPE_EXIT( Py_DECREF(instance); );
ON_SCOPE_EXIT { Py_DECREF(instance); };
if (instance->ob_type->tp_base == nullptr || instance->ob_type->tp_base->tp_name != "ImHexType"s) {
PyErr_SetString(PyExc_TypeError, "class type must extend from ImHexType");
@@ -104,7 +104,7 @@ namespace hex {
return nullptr;
}
SCOPE_EXIT( Py_DECREF(list); );
ON_SCOPE_EXIT { Py_DECREF(list); };
std::string code = keyword + " " + instance->ob_type->tp_name + " {\n";