Skip to content

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

Open
@tremble

Description

@tremble

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions