Skip to content

[3.12] gh-127667: refactor and improve _hashopenssl.c error branches (#131145) #131348

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

Conversation

picnixz
Copy link
Member

@picnixz picnixz commented Mar 17, 2025

Refactor _setException() into different helpers that can be used separately:

  • set_ssl_exception_from_errcode(): set an exception from an explicit SSL error code.
  • raise_ssl_error(): set an exception from the last SSL error code or use a user-defined message.
  • notify_ssl_error_occurred(): same as raise_ssl_error() but with a generic default message.

(cherry-picked from commit ac50ece).

…python#131145)

Refactor `_setException()` into different helpers that can be used separately:

- set_ssl_exception_from_errcode(): set an exception from an explicit SSL error code.
- raise_ssl_error(): set an exception from the last SSL error code or use a user-defined message.
- notify_ssl_error_occurred(): same as raise_ssl_error() but with a generic default message.
@picnixz picnixz requested a review from gpshead March 17, 2025 10:27
@picnixz picnixz merged commit 304ef84 into python:3.12 Mar 18, 2025
29 checks passed
@picnixz picnixz deleted the bp-312/ac50ece6cea8745834e4ec0a9617809a51245bfc/refactor-hashlib-127667 branch March 18, 2025 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant