From 2d8cc7cd085d024ca3fddce394501815aa58eb06 Mon Sep 17 00:00:00 2001 From: David Hewitt <1939362+davidhewitt@users.noreply.github.com> Date: Sat, 6 Mar 2021 16:40:39 +0000 Subject: [PATCH] ffi: update PyConfig for Python 3.10 --- src/ffi/cpython/initconfig.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ffi/cpython/initconfig.rs b/src/ffi/cpython/initconfig.rs index d6d67720b54..e34e801a870 100644 --- a/src/ffi/cpython/initconfig.rs +++ b/src/ffi/cpython/initconfig.rs @@ -101,7 +101,10 @@ pub struct PyConfig { pub filesystem_errors: *mut wchar_t, pub pycache_prefix: *mut wchar_t, pub parse_argv: c_int, + #[cfg(Py_3_10)] + pub orig_argv: PyWideStringList, pub argv: PyWideStringList, + #[cfg(not(Py_3_10))] pub program_name: *mut wchar_t, pub xoptions: PyWideStringList, pub warnoptions: PyWideStringList, @@ -124,9 +127,14 @@ pub struct PyConfig { pub legacy_windows_stdio: c_int, pub check_hash_pycs_mode: *mut wchar_t, + #[cfg(Py_3_10)] + pub program_name: *mut wchar_t, pub pathconfig_warnings: c_int, pub pythonpath_env: *mut wchar_t, pub home: *mut wchar_t, + #[cfg(Py_3_10)] + pub platlibdir: *mut wchar_t, + pub module_search_paths_set: c_int, pub module_search_paths: PyWideStringList, pub executable: *mut wchar_t, @@ -135,7 +143,7 @@ pub struct PyConfig { pub base_prefix: *mut wchar_t, pub exec_prefix: *mut wchar_t, pub base_exec_prefix: *mut wchar_t, - #[cfg(Py_3_9)] + #[cfg(all(Py_3_9, not(Py_3_10)))] pub platlibdir: *mut wchar_t, pub skip_source_first_line: c_int, pub run_command: *mut wchar_t, @@ -145,7 +153,7 @@ pub struct PyConfig { pub _init_main: c_int, #[cfg(Py_3_9)] pub _isolated_interpreter: c_int, - #[cfg(Py_3_9)] + #[cfg(all(Py_3_9, not(Py_3_10)))] pub orig_argv: PyWideStringList, }