Message108409
>>> Actually, you should be able to just remove the asserts.
Aha, thanks!
Yes: #define PY_SSIZE_T_CLEAN is defined at the top of Objects/exceptions.c, so yes, Py_VaBuildValue is redirected to _Py_VaBuildValue_SizeT, so that
PyEval_CallFunction
calls:
Py_VaBuildValue(format, vargs)
which is preprocessed to:
_Py_VaBuildValue_SizeT
which calls:
return va_build_value(format, va, FLAG_SIZE_T);
which means that "s#" is processed with flags==FLAG_SIZE_T, and thus as "Py_ssize_t" within do_mkvalue:
if (flags & FLAG_SIZE_T)
n = va_arg(*p_va, Py_ssize_t);
else
n = va_arg(*p_va, int);
So, yes, it does look like the three assert lines can simply be removed. |
|
Date |
User |
Action |
Args |
2010-06-22 19:06:11 | dmalcolm | set | recipients:
+ dmalcolm, benjamin.peterson |
2010-06-22 19:06:11 | dmalcolm | set | messageid: <1277233571.65.0.356221860324.issue9058@psf.upfronthosting.co.za> |
2010-06-22 19:06:09 | dmalcolm | link | issue9058 messages |
2010-06-22 19:06:09 | dmalcolm | create | |
|