mirror of
https://github.com/python/cpython.git
synced 2025-08-28 04:35:02 +00:00
gh-126223: Propagate unicode errors in _interpreters.create()
(#126224)
Co-authored-by: sobolevn <mail@sobolevn.me> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
This commit is contained in:
parent
8c22eba877
commit
01415213d7
3 changed files with 10 additions and 1 deletions
|
@ -402,7 +402,11 @@ config_from_object(PyObject *configobj, PyInterpreterConfig *config)
|
|||
}
|
||||
}
|
||||
else if (PyUnicode_Check(configobj)) {
|
||||
if (init_named_config(config, PyUnicode_AsUTF8(configobj)) < 0) {
|
||||
const char *utf8name = PyUnicode_AsUTF8(configobj);
|
||||
if (utf8name == NULL) {
|
||||
return -1;
|
||||
}
|
||||
if (init_named_config(config, utf8name) < 0) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue