mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-45855: Replaced deprecated PyImport_ImportModuleNoBlock
with PyImport_ImportModule (GH-30046)
This commit is contained in:
parent
e6fe10d340
commit
41026c3155
12 changed files with 17 additions and 16 deletions
|
@ -1527,7 +1527,7 @@ static int _PyCodecRegistry_Init(void)
|
|||
}
|
||||
}
|
||||
|
||||
mod = PyImport_ImportModuleNoBlock("encodings");
|
||||
mod = PyImport_ImportModule("encodings");
|
||||
if (mod == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -447,7 +447,7 @@ display_source_line_with_margin(PyObject *f, PyObject *filename, int lineno, int
|
|||
}
|
||||
}
|
||||
|
||||
io = PyImport_ImportModuleNoBlock("io");
|
||||
io = PyImport_ImportModule("io");
|
||||
if (io == NULL)
|
||||
return -1;
|
||||
binary = _PyObject_CallMethodId(io, &PyId_open, "Os", filename, "rb");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue