commit:     916aba5a91733a2f39ea26e35879fc2f993e7ad1
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  4 07:07:44 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Jun  5 18:34:30 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=916aba5a

Replace deprecated distutils.sysconfig uses

Closes: https://github.com/gentoo/portage/pull/725
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/ebuild-ipc.py | 6 ++++--
 bin/portageq      | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/bin/ebuild-ipc.py b/bin/ebuild-ipc.py
index 32f6d53b9..fa6ac4395 100755
--- a/bin/ebuild-ipc.py
+++ b/bin/ebuild-ipc.py
@@ -43,8 +43,10 @@ if 
os.path.isfile(os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(
        pym_paths = 
[os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 
"lib")]
        sys.path.insert(0, pym_paths[0])
 else:
-       import distutils.sysconfig
-       pym_paths = [os.path.join(distutils.sysconfig.get_python_lib(), x) for 
x in ("_emerge", "portage")]
+       import sysconfig
+       pym_paths = [
+               os.path.join(sysconfig.get_path("purelib"), x) for x in 
("_emerge", "portage")
+       ]
 # Avoid sandbox violations after Python upgrade.
 if os.environ.get("SANDBOX_ON") == "1":
        sandbox_write = os.environ.get("SANDBOX_WRITE", "").split(":")

diff --git a/bin/portageq b/bin/portageq
index 67fdc9d38..385259f9d 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -26,8 +26,10 @@ if 
os.path.isfile(os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(
        pym_paths = 
[os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 
"lib")]
        sys.path.insert(0, pym_paths[0])
 else:
-       import distutils.sysconfig
-       pym_paths = [os.path.join(distutils.sysconfig.get_python_lib(), x) for 
x in ("_emerge", "portage")]
+       import sysconfig
+       pym_paths = [
+               os.path.join(sysconfig.get_path("purelib"), x) for x in 
("_emerge", "portage")
+       ]
 # Avoid sandbox violations after Python upgrade.
 if os.environ.get("SANDBOX_ON") == "1":
        sandbox_write = os.environ.get("SANDBOX_WRITE", "").split(":")

Reply via email to