summaryrefslogtreecommitdiffstats
path: root/Include/internal
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-05-13 23:48:38 (GMT)
committerGitHub <noreply@github.com>2020-05-13 23:48:38 (GMT)
commit3d17c045b4c3d09b72bbd95ed78af1ae6f0d98d2 (patch)
tree5d137440f0cdf1312b7cc0b25516490faf42d711 /Include/internal
parent75cd8e48c62c97fdb9d9a94fd2335be06084471d (diff)
downloadcpython-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.h22
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