diff --git a/Misc/NEWS.d/next/Library/2022-05-05-19-25-09.gh-issue-92356.uvxWdu.rst b/Misc/NEWS.d/next/Library/2022-05-05-19-25-09.gh-issue-92356.uvxWdu.rst new file mode 100644 index 0000000000000000000000000000000000000000..9c9566e5b9d7197e03e816a7b484c8488a9088ab --- /dev/null +++ b/Misc/NEWS.d/next/Library/2022-05-05-19-25-09.gh-issue-92356.uvxWdu.rst @@ -0,0 +1 @@ +Fixed a performance regression in ctypes function calls. diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c index 23c11c98b2afce0225f53281a9dd7ff028382a91..c7234fbb18a0fa8e60ae6a717e5e292382903795 100644 --- a/Modules/_ctypes/cfield.c +++ b/Modules/_ctypes/cfield.c @@ -1602,6 +1602,7 @@ _ctypes_get_fielddesc(const char *fmt) struct fielddesc *table = formattable; if (!initialized) { + initialized = 1; _ctypes_init_fielddesc(); }