try:
    import foo
except (ValueError, ModuleNotFoundError):
    foo = None
