Skip to content

Commit d74dff7

Browse files
committed
Set argtypes for sprintf from ctypes
Needed on some architectures (see the "Calling variadic functions" in the ctypes documentation).
1 parent f3e9cf0 commit d74dff7

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

mpmath/tests/test_format.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,7 @@ def test_hexadecimal_bulk(x):
864864
def float_print(d, i):
865865
fmt = "%." + str(i) + "a\n"
866866
a = ctypes.create_string_buffer(256)
867+
libc.sprintf.argtypes = [ctypes.c_char_p, ctypes.c_char_p]
867868
libc.sprintf(a, bytes(fmt, 'utf-8'), ctypes.c_double(d))
868869
return a.raw.decode('utf-8').split("\n")[0]
869870

0 commit comments

Comments
 (0)