mirror of
https://github.com/python/cpython.git
synced 2025-08-24 02:35:59 +00:00
gh-130790: Remove references about unicode's readiness from comments (#130801)
This commit is contained in:
parent
8a64a62002
commit
3a7f17c7e2
11 changed files with 9 additions and 28 deletions
|
@ -1256,7 +1256,6 @@ _PyCodec_SurrogatePassUnicodeEncodeError(PyObject *exc)
|
|||
|
||||
unsigned char *outp = (unsigned char *)PyBytes_AsString(res);
|
||||
for (Py_ssize_t i = start; i < end; i++) {
|
||||
/* object is guaranteed to be "ready" */
|
||||
Py_UCS4 ch = PyUnicode_READ_CHAR(obj, i);
|
||||
if (!Py_UNICODE_IS_SURROGATE(ch)) {
|
||||
/* Not a surrogate, fail with original exception */
|
||||
|
|
|
@ -867,7 +867,6 @@ format_string_internal(PyObject *value, const InternalFormatSpec *format,
|
|||
int result = -1;
|
||||
Py_UCS4 maxchar;
|
||||
|
||||
assert(PyUnicode_IS_READY(value));
|
||||
len = PyUnicode_GET_LENGTH(value);
|
||||
|
||||
/* sign is not allowed on strings */
|
||||
|
|
|
@ -249,14 +249,6 @@ tracemalloc_get_frame(_PyInterpreterFrame *pyframe, frame_t *frame)
|
|||
#endif
|
||||
return;
|
||||
}
|
||||
if (!PyUnicode_IS_READY(filename)) {
|
||||
/* Don't make a Unicode string ready to avoid reentrant calls
|
||||
to tracemalloc_alloc() or tracemalloc_realloc() */
|
||||
#ifdef TRACE_DEBUG
|
||||
tracemalloc_error("filename is not a ready unicode string");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
/* intern the filename */
|
||||
_Py_hashtable_entry_t *entry;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue