From fc6e89c8b15a73381b26930c4c4243c6d2bbb733 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Sun, 26 Jan 2025 13:13:20 +0100 Subject: [PATCH] test_config: get the last PyConfig member --- tests/test_pythoncapi_compat_cext.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_pythoncapi_compat_cext.c b/tests/test_pythoncapi_compat_cext.c index bae0ee3..9d324a4 100644 --- a/tests/test_pythoncapi_compat_cext.c +++ b/tests/test_pythoncapi_compat_cext.c @@ -2148,6 +2148,15 @@ test_config(PyObject *Py_UNUSED(module), PyObject *Py_UNUSED(args)) assert(PyLong_Check(obj)); Py_DECREF(obj); + // Get the last member +#if 0x030A0000 <= PY_VERSION_HEX + obj = PyConfig_Get("warn_default_encoding"); +#else + obj = PyConfig_Get("user_site_directory"); +#endif + assert(PyLong_Check(obj)); + Py_DECREF(obj); + assert(PyConfig_Get("nonexistent") == NULL); assert(PyErr_ExceptionMatches(PyExc_ValueError)); PyErr_Clear(); pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy