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

Cannot import ADLError #9

Open
ReenigneArcher opened this issue Dec 8, 2022 · 0 comments
Open

Cannot import ADLError #9

ReenigneArcher opened this issue Dec 8, 2022 · 0 comments

Comments

@ReenigneArcher
Copy link

Firstly, I understand there has not been activity on this repo in several years. Still, hoping this can be addressed.

Importing ADLManager like so works, but PyCharm (and probably other IDEs) complain about "too broad exception" and for good reason.

    try:
        from pyadl import ADLManager
    except Exception:  # cannot import `ADLError` from `pyadl.pyadl`
        pass  # no amd gpus found
    else:
        ...

Ideally it would say except ADLError:, unfortunately it is also not possible to import ADLError.

I believe that it should just throw the original OSError so that it can be handled more properly by users of the library.

raise ADLError("Driver not found!")

I'm happy to create a PR if such a change would be accepted. Please let me know. Thanks!

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