Skip to content

Commit

Permalink
Fix get_system_sitepackages_and_suffixes() on systems where /usr/libe…
Browse files Browse the repository at this point in the history
…xec/platform-python is python 2.7 (issue 17)
  • Loading branch information
ian-hurst authored and ianh-edico committed Oct 31, 2024
1 parent 1ef19df commit 23054b8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions rpm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,20 @@ def get_system_sitepackages_and_suffixes() -> List[Dict[str, List[str]]]:
def get_sitepackages_and_suffixes(interpreter):
script = textwrap.dedent(
"""
import importlib
import importlib.machinery
import json
import site
try:
import importlib.machinery
except ImportError:
suffixes = []
else:
suffixes = importlib.machinery.EXTENSION_SUFFIXES
print(
json.dumps(
{
"sitepackages": site.getsitepackages(),
"suffixes": importlib.machinery.EXTENSION_SUFFIXES,
"suffixes": suffixes,
}
)
)
Expand Down

0 comments on commit 23054b8

Please sign in to comment.