From: Kefu Chai Date: Sun, 29 Mar 2026 06:23:31 +0000 (+0800) Subject: mgr: replace deprecated PyImport_ImportModuleNoBlock with PyImport_ImportModule X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F68085%2Fhead;p=ceph.git mgr: replace deprecated PyImport_ImportModuleNoBlock with PyImport_ImportModule PyImport_ImportModuleNoBlock was deprecated in Python 3.13: PyModule.cc:374:21: warning: 'PyImport_ImportModuleNoBlock' is deprecated [-Wdeprecated-declarations] The "no block" variant was introduced to avoid deadlocking on Python 2's single global import lock, but Python 3's per-module locking (since 3.3) made the distinction meaningless. PyImport_ImportModule is the direct replacement and is compatible with all Python versions. Signed-off-by: Kefu Chai --- diff --git a/src/mgr/PyModule.cc b/src/mgr/PyModule.cc index 1c75d70f4663..b974a60b265f 100644 --- a/src/mgr/PyModule.cc +++ b/src/mgr/PyModule.cc @@ -371,7 +371,7 @@ int PyModule::load(PyThreadState *pMainThreadState) int r; - pPickleModule = PyImport_ImportModuleNoBlock("pickle"); + pPickleModule = PyImport_ImportModule("pickle"); if (!pPickleModule) { derr << "Unable to load pickle" << dendl; return -EINVAL;