mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +00:00
Implement PEP 393.
This commit is contained in:
parent
48d49497c5
commit
d63a3b8beb
102 changed files with 8153 additions and 5431 deletions
|
@ -1525,10 +1525,10 @@ symtable_visit_alias(struct symtable *st, alias_ty a)
|
|||
*/
|
||||
PyObject *store_name;
|
||||
PyObject *name = (a->asname == NULL) ? a->name : a->asname;
|
||||
const Py_UNICODE *base = PyUnicode_AS_UNICODE(name);
|
||||
Py_UNICODE *dot = Py_UNICODE_strchr(base, '.');
|
||||
if (dot) {
|
||||
store_name = PyUnicode_FromUnicode(base, dot - base);
|
||||
Py_ssize_t dot = PyUnicode_FindChar(name, '.', 0,
|
||||
PyUnicode_GET_LENGTH(name), 1);
|
||||
if (dot != -1) {
|
||||
store_name = PyUnicode_Substring(name, 0, dot);
|
||||
if (!store_name)
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue