CI: replace depreciated module (MR 4500)

See PEP 632: https://peps.python.org/pep-0632

Closes https://gitlab.com/postmarketOS/pmaports/-/issues/2207
This commit is contained in:
Stefan Hansson 2023-10-21 15:06:20 +02:00 committed by Oliver Smith
parent 5dec8f2c87
commit c5b66e4090
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -7,7 +7,7 @@ import sys
import os import os
import importlib import importlib
import importlib.util import importlib.util
from distutils.sysconfig import get_python_lib from site import getsitepackages
def path_pmbootstrap(): def path_pmbootstrap():
@ -28,9 +28,10 @@ def path_pmbootstrap():
if os.path.exists(dir + "/pmb/__init__.py"): if os.path.exists(dir + "/pmb/__init__.py"):
return dir return dir
dir = get_python_lib() directories = getsitepackages()
if os.path.exists(dir + "/pmb/__init__.py"): for directory in directories:
return dir if os.path.exists(directory + "/pmb/__init__.py"):
return directory
# Symlink not set up properly # Symlink not set up properly
print("ERROR: 'pmbootstrap' is not a symlink to pmbootstrap.py") print("ERROR: 'pmbootstrap' is not a symlink to pmbootstrap.py")