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

Give a sensible error when pkg-config is not installed? #60

Closed
karolyi opened this issue Feb 16, 2022 · 3 comments
Closed

Give a sensible error when pkg-config is not installed? #60

karolyi opened this issue Feb 16, 2022 · 3 comments

Comments

@karolyi
Copy link

karolyi commented Feb 16, 2022

Coming from yaml/pyyaml#618, your package bails out hard when the pkg-config binary is not present on the system, which can be a case.

Could you please provide some preliminary checks and maybe a custom exception for that, please?

@matze
Copy link
Owner

matze commented Feb 16, 2022

Could you please provide some preliminary checks and maybe a custom exception for that, please?

There are checks and in case the binary is not found, EnvironmentError is thrown. What else do you expect? Since this is a library it is expected that users handle potential exceptions.

@karolyi
Copy link
Author

karolyi commented Feb 16, 2022

I see. The traceback I saw was somewhat convoluted for me, hence I thought it's not handled correctly.

Also, from the EnvironmentError documentation:

The following exceptions are kept for compatibility with previous versions; starting from Python 3.3, they are aliases of OSError.

@karolyi karolyi closed this as completed Feb 16, 2022
@karolyi
Copy link
Author

karolyi commented Feb 16, 2022

Not sure where you raise an "original OSError" (stated in the changelog), but you might want to use a different error instead of EnvironmentError, if the two aren't the same?

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

2 participants