summaryrefslogtreecommitdiffstats
path: root/Objects/unicodeobject.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-08-03 13:33:52 (GMT)
committerGitHub <noreply@github.com>2018-08-03 13:33:52 (GMT)
commitcaba55b3b735405b280273f7d99866a046c18281 (patch)
tree3a98ac383b1fbab272158933255fb1a14107ebf6 /Objects/unicodeobject.c
parent2ebd3813af9172fe1f9b2f6004edf6f1e1e5d9f1 (diff)
downloadcpython-caba55b3b735405b280273f7d99866a046c18281.zip
cpython-caba55b3b735405b280273f7d99866a046c18281.tar.gz
cpython-caba55b3b735405b280273f7d99866a046c18281.tar.bz2
bpo-34301: Add _PyInterpreterState_Get() helper function (GH-8592)
sys_setcheckinterval() now uses a local variable to parse arguments, before writing into interp->check_interval.
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r--Objects/unicodeobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 2b06f15..04fd6d0 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -3413,7 +3413,7 @@ PyUnicode_EncodeFSDefault(PyObject *unicode)
#if defined(__APPLE__)
return _PyUnicode_AsUTF8String(unicode, Py_FileSystemDefaultEncodeErrors);
#else
- PyInterpreterState *interp = PyThreadState_GET()->interp;
+ PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE();
/* Bootstrap check: if the filesystem codec is implemented in Python, we
cannot use it to encode and decode filenames before it is loaded. Load
the Python codec requires to encode at least its own filename. Use the C
@@ -3639,7 +3639,7 @@ PyUnicode_DecodeFSDefaultAndSize(const char *s, Py_ssize_t size)
#if defined(__APPLE__)
return PyUnicode_DecodeUTF8Stateful(s, size, Py_FileSystemDefaultEncodeErrors, NULL);
#else
- PyInterpreterState *interp = PyThreadState_GET()->interp;
+ PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE();
/* Bootstrap check: if the filesystem codec is implemented in Python, we
cannot use it to encode and decode filenames before it is loaded. Load
the Python codec requires to encode at least its own filename. Use the C