Skip to content

Commit 375983c

Browse files
committed
python: make the auto-buffer assertion more helpful
1 parent de6316d commit 375983c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/swig_python/python_extra.py_in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def _wrap_bin(fn, length, resize=False):
99
if resize:
1010
# Truncate buf to bytes written if needed. Also assert the
1111
# wrapper allocated enough space for the returned value to fit.
12-
assert ret <= n
12+
assert ret <= n, f'{fn.__name__}: {ret} > {n}'
1313
return buf[0:ret] if ret != n else buf
1414
if ret is not None:
1515
assert ret == n

0 commit comments

Comments
 (0)