diff options
author | Victor Stinner <vstinner@python.org> | 2020-04-14 15:14:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-14 15:14:01 +0200 |
commit | 81a7be3fa22c983209cc0ffb3537b92b0370f83c (patch) | |
tree | c257d7143ecc60574353caa76fa2992a455ebb54 /Objects/unicodeobject.c | |
parent | 4a3fe0835310643193ea45529ab0fb45c5f8f2fd (diff) | |
download | cpython-git-81a7be3fa22c983209cc0ffb3537b92b0370f83c.tar.gz |
bpo-40268: Rename _PyInterpreterState_GET_UNSAFE() (GH-19509)
Rename _PyInterpreterState_GET_UNSAFE() to _PyInterpreterState_GET()
for consistency with _PyThreadState_GET() and to have a shorter name
(help to fit into 80 columns).
Add also "assert(tstate != NULL);" to the function.
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r-- | Objects/unicodeobject.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 938df24e1d..28ec8f10dc 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -436,7 +436,7 @@ unicode_check_encoding_errors(const char *encoding, const char *errors) return 0; } - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); #ifndef Py_DEBUG /* In release mode, only check in development mode (-X dev) */ if (!_PyInterpreterState_GetConfig(interp)->dev_mode) { @@ -3615,7 +3615,7 @@ PyUnicode_EncodeLocale(PyObject *unicode, const char *errors) PyObject * PyUnicode_EncodeFSDefault(PyObject *unicode) { - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); if (interp->fs_codec.utf8) { return unicode_encode_utf8(unicode, interp->fs_codec.error_handler, @@ -3851,7 +3851,7 @@ PyUnicode_DecodeFSDefault(const char *s) { PyObject* PyUnicode_DecodeFSDefaultAndSize(const char *s, Py_ssize_t size) { - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); if (interp->fs_codec.utf8) { return unicode_decode_utf8(s, size, interp->fs_codec.error_handler, @@ -16009,7 +16009,7 @@ _PyUnicode_FiniEncodings(PyThreadState *tstate) int _PyUnicode_EnableLegacyWindowsFSEncoding(void) { - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); PyConfig *config = (PyConfig *)_PyInterpreterState_GetConfig(interp); /* Set the filesystem encoding to mbcs/replace (PEP 529) */ |