@@ -2561,25 +2561,25 @@ class CppPythonBindingsCodeCache(CppCodeCache):
2561
2561
}
2562
2562
template <> inline long parse_arg<long>(PyObject* args, size_t n) {
2563
2563
auto result = PyLong_AsSsize_t(PyTuple_GET_ITEM(args, n));
2564
- if(result == -1 && PyErr_Occurred())
2565
- [[unlikely]] throw std::runtime_error("expected int arg");
2564
+ if(unlikely( result == -1 && PyErr_Occurred() ))
2565
+ throw std::runtime_error("expected int arg");
2566
2566
return result;
2567
2567
}
2568
2568
template <> inline uintptr_t parse_arg<uintptr_t>(PyObject* args, size_t n) {
2569
2569
auto result = PyLong_AsVoidPtr(PyTuple_GET_ITEM(args, n));
2570
- if(result == reinterpret_cast<void*>(-1) && PyErr_Occurred())
2571
- [[unlikely]] throw std::runtime_error("expected int arg");
2570
+ if(unlikely( result == reinterpret_cast<void*>(-1) && PyErr_Occurred() ))
2571
+ throw std::runtime_error("expected int arg");
2572
2572
return reinterpret_cast<uintptr_t>(result);
2573
2573
}
2574
2574
2575
2575
%s
2576
2576
2577
2577
static PyObject* %s_py(PyObject* self, PyObject* args) {
2578
2578
try {
2579
- if(!PyTuple_CheckExact(args))
2580
- [[unlikely]] throw std::runtime_error("tuple args required");
2581
- if(PyTuple_GET_SIZE(args) != %s)
2582
- [[unlikely]] throw std::runtime_error("requires %s args");
2579
+ if(unlikely( !PyTuple_CheckExact(args) ))
2580
+ throw std::runtime_error("tuple args required");
2581
+ if(unlikely( PyTuple_GET_SIZE(args) != %s) )
2582
+ throw std::runtime_error("requires %s args");
2583
2583
%s
2584
2584
} catch(std::exception const& e) {
2585
2585
PyErr_SetString(PyExc_RuntimeError, e.what());
0 commit comments