Skip to content

Commit 81eefa7

Browse files
authored
test_config: get the last PyConfig member (#135)
1 parent 4c53701 commit 81eefa7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: tests/test_pythoncapi_compat_cext.c

+9
Original file line numberDiff line numberDiff line change
@@ -2148,6 +2148,15 @@ test_config(PyObject *Py_UNUSED(module), PyObject *Py_UNUSED(args))
21482148
assert(PyLong_Check(obj));
21492149
Py_DECREF(obj);
21502150

2151+
// Get the last member
2152+
#if 0x030A0000 <= PY_VERSION_HEX
2153+
obj = PyConfig_Get("warn_default_encoding");
2154+
#else
2155+
obj = PyConfig_Get("user_site_directory");
2156+
#endif
2157+
assert(PyLong_Check(obj));
2158+
Py_DECREF(obj);
2159+
21512160
assert(PyConfig_Get("nonexistent") == NULL);
21522161
assert(PyErr_ExceptionMatches(PyExc_ValueError));
21532162
PyErr_Clear();

0 commit comments

Comments
 (0)