Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support cleanly catching the missing 'real' bindings. #64

Open
tremble opened this issue Jan 2, 2023 · 0 comments
Open

Support cleanly catching the missing 'real' bindings. #64

tremble opened this issue Jan 2, 2023 · 0 comments

Comments

@tremble
Copy link

tremble commented Jan 2, 2023

If the shim's been installed, but the system library is missing, then check_system_sitepackages currently raises Exception.

Since check_system_sitepackages() will only be called as a result of import selinux it would make more sense for this to raise an ImportError rather than the more generic Exception.

This can currently cause problems with things like a Python 3.9 virtual environment on RHEL8 where only the 3.6 bindings are shipped. If something pulls selinux into the venv as a dependency suddenly the usual practice of using except ImportError to catch the missing bindings won't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant