Skip to content

Commit

Permalink
Ignore extension suffixes if the interpreter is Python 2 (#18)
Browse files Browse the repository at this point in the history
Ignore extension suffixes if the interpreter is Python 2

TODO:

 Write new tests or update the old ones to cover new functionality.
 Update doc-strings where appropriate.
 Update or write new documentation in packit/packit.dev.


Fixes Issue 17

RELEASE NOTES BEGIN
Ignore extension suffixes if the interpreter is Python 2
RELEASE NOTES END

Reviewed-by: Nikola Forró
Reviewed-by: ian-hurst
  • Loading branch information
softwarefactory-project-zuul[bot] authored Oct 31, 2024
2 parents 1ef19df + ff35059 commit d66de56
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 d66de56

Please sign in to comment.