Skip to content

Commit 5de4798

Browse files
committed
Improve error message for librt abi mismatch
1 parent 68d8f9d commit 5de4798

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

mypyc/lib-rt/librt_internal.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,12 @@ import_librt_internal(void)
6464
return -1;
6565
memcpy(NativeInternal_API, capsule, sizeof(NativeInternal_API));
6666
if (NativeInternal_ABI_Version() != LIBRT_INTERNAL_ABI_VERSION) {
67-
PyErr_SetString(PyExc_ValueError, "ABI version conflict for librt.internal");
67+
char err[64];
68+
snprintf(err, sizeof(err), "ABI version conflict for librt.internal, expected %d, found %d",
69+
LIBRT_INTERNAL_ABI_VERSION,
70+
NativeInternal_ABI_Version(),
71+
);
72+
PyErr_SetString(PyExc_ValueError, err);
6873
return -1;
6974
}
7075
return 0;

0 commit comments

Comments
 (0)