diff options
author | Victor Stinner <vstinner@python.org> | 2020-05-13 23:48:38 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-13 23:48:38 (GMT) |
commit | 3d17c045b4c3d09b72bbd95ed78af1ae6f0d98d2 (patch) | |
tree | 5d137440f0cdf1312b7cc0b25516490faf42d711 /Include/internal | |
parent | 75cd8e48c62c97fdb9d9a94fd2335be06084471d (diff) | |
download | cpython-3d17c045b4c3d09b72bbd95ed78af1ae6f0d98d2.zip cpython-3d17c045b4c3d09b72bbd95ed78af1ae6f0d98d2.tar.gz cpython-3d17c045b4c3d09b72bbd95ed78af1ae6f0d98d2.tar.bz2 |
bpo-40521: Add PyInterpreterState.unicode (GH-20081)
Move PyInterpreterState.fs_codec into a new
PyInterpreterState.unicode structure.
Give a name to the fs_codec structure and use this structure in
unicodeobject.c.
Diffstat (limited to 'Include/internal')
-rw-r--r-- | Include/internal/pycore_interp.h | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/Include/internal/pycore_interp.h b/Include/internal/pycore_interp.h index 26e7a47..f04ea33 100644 --- a/Include/internal/pycore_interp.h +++ b/Include/internal/pycore_interp.h @@ -51,6 +51,19 @@ struct _ceval_state { #endif }; +/* fs_codec.encoding is initialized to NULL. + Later, it is set to a non-NULL string by _PyUnicode_InitEncodings(). */ +struct _Py_unicode_fs_codec { + char *encoding; // Filesystem encoding (encoded to UTF-8) + int utf8; // encoding=="utf-8"? + char *errors; // Filesystem errors (encoded to UTF-8) + _Py_error_handler error_handler; +}; + +struct _Py_unicode_state { + struct _Py_unicode_fs_codec fs_codec; +}; + /* interpreter state */ @@ -97,14 +110,7 @@ struct _is { PyObject *codec_error_registry; int codecs_initialized; - /* fs_codec.encoding is initialized to NULL. - Later, it is set to a non-NULL string by _PyUnicode_InitEncodings(). */ - struct { - char *encoding; /* Filesystem encoding (encoded to UTF-8) */ - int utf8; /* encoding=="utf-8"? */ - char *errors; /* Filesystem errors (encoded to UTF-8) */ - _Py_error_handler error_handler; - } fs_codec; + struct _Py_unicode_state unicode; PyConfig config; #ifdef HAVE_DLOPEN |