]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.11] gh-93741: Add private C API _PyImport_GetModuleAttrString() (GH-93742) (GH...
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 14 Jun 2022 05:51:39 +0000 (08:51 +0300)
committerGitHub <noreply@github.com>
Tue, 14 Jun 2022 05:51:39 +0000 (08:51 +0300)
commitd42b3689f4a14694f5b1ff75c155141102aa2557
treea8adaba47e89c98c6be3d0040f94ea909e321ba4
parent02ff1ccfb702e740d08cd4f546cf0e51f929c718
[3.11] gh-93741: Add private C API _PyImport_GetModuleAttrString() (GH-93742) (GH-93792)

It combines PyImport_ImportModule() and PyObject_GetAttrString()
and saves 4-6 lines of code on every use.

Add also _PyImport_GetModuleAttr() which takes Python strings as arguments.
(cherry picked from commit 6fd4c8ec7740523bb81191c013118d9d6959bc9d)
Include/cpython/import.h
Python/import.c