Skip to content

importorskip variant that uses ModuleNotFoundError #11523

@graingert

Description

@graingert

What's the problem this feature will solve?

sometimes I install a package eg PyTables and it fails to compile properly and fails with an ImportError with an undefined symbol, however I don't see this in CI because I only do pytest.importorskip("pytables")

Describe the solution you'd like

a new kwarg to importorskip or a new function that catches ModuleNotFoundError instead of ImportError eg
importorskip(exc=ModuleNotFoundError) or findmoduleorskip(...)

Alternative Solutions

N/A

Additional context

Originally asked on discord

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueeasy issue that is friendly to new contributortype: proposalproposal for a new feature, often to gather opinions or design the API around the new feature

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions