Skip to content

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

Merged
picnixz merged 1 commit into
python:3.13from
picnixz:bp-313/ac50ece6cea8745834e4ec0a9617809a51245bfc/refactor-hashlib-127667
Mar 18, 2025
Merged

picnixz merged 1 commit into
python:3.13from
picnixz:bp-313/ac50ece6cea8745834e4ec0a9617809a51245bfc/refactor-hashlib-127667

Conversation

@picnixz

@picnixz picnixz commented Mar 17, 2025 •

Copy link
Copy Markdown
Member

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.

# Conflicts:
#	Modules/_hashopenssl.c
@picnixz
picnixz requested a review from gpshead March 17, 2025 10:27
@picnixz
picnixz merged commit 170abd2 into python:3.13 Mar 18, 2025
@picnixz
picnixz deleted the bp-313/ac50ece6cea8745834e4ec0a9617809a51245bfc/refactor-hashlib-127667 branch March 18, 2025 09:16
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