Skip to content

Raise BadPythonDllException instead of confusing TypeLoadException when PythonDLL was not configured properly #1577

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

Merged
merged 1 commit into from
Sep 29, 2021

Conversation

lostmsu
Copy link
Member

@lostmsu lostmsu commented Sep 29, 2021

What does this implement/fix? Explain your changes.

This handles failure to load internal Delegates type due to misconfigured PythonDLL, which used to raise TypeLoadException whose InnerException would give users the details. Unfortunately, some users do not bother to go as far as to look into the InnerException, and instead go straight to GitHub and report "a bug".

This change handles that TypeLoadException and rethrows it as BadPythonDllException in major entry points, which makes looking into InnerException unnecessary, hopefully reducing the number of "bugs"

Checklist

Check all those that are applicable and complete.

  • Make sure to include one or more tests for your change
  • If an enhancement PR, please create docs and at best an example
  • Add yourself to AUTHORS
  • Updated the CHANGELOG

…ption) instead of confusing TypeLoadException when PythonDLL was not configured properly
@lostmsu lostmsu merged commit 23ec9d2 into pythonnet:master Sep 29, 2021
@lostmsu lostmsu deleted the less-confusing-delegates-loading branch September 29, 2021 06:02
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

Successfully merging this pull request may close these issues.

2 participants