This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Dead assignment in _ssl__SSLContext_load_verify_locations_impl
Type: performance Stage: resolved
Components: SSL Versions: Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: christian.heimes Nosy List: alex.henrie, christian.heimes, vstinner
Priority: normal Keywords: patch

Created on 2020-01-09 04:27 by alex.henrie, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 17916 merged alex.henrie, 2020-01-09 04:28
Messages (2)
msg359654 - (view) Author: Alex Henrie (alex.henrie) * Date: 2020-01-09 04:27
The function _ssl__SSLContext_load_verify_locations_impl currently contains the following code:

        if (r != 1) {
            ok = 0;
            if (errno != 0) {
                ERR_clear_error();
                PyErr_SetFromErrno(PyExc_OSError);
            }
            else {
                _setSSLError(NULL, 0, __FILE__, __LINE__);
            }
            goto error;
        }
    }
    goto end;

  error:
    ok = 0;

It is unnecessary to set ok to 0 before jumping to error because the first instruction after the error label does the same thing.
msg359658 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-01-09 09:12
New changeset a1c1be24cb3ae25b5b53e9dc94d6327009626283 by Victor Stinner (Alex Henrie) in branch 'master':
bpo-39272: Remove dead assignment from _ssl__SSLContext_load_verify_locations_impl (GH-17916)
https://github.com/python/cpython/commit/a1c1be24cb3ae25b5b53e9dc94d6327009626283
History
Date User Action Args
2022-04-11 14:59:25adminsetgithub: 83453
2020-01-09 09:12:42vstinnersetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-01-09 09:12:32vstinnersetnosy: + vstinner
messages: + msg359658
2020-01-09 04:28:33alex.henriesetkeywords: + patch
stage: patch review
pull_requests: + pull_request17328
2020-01-09 04:27:44alex.henriecreate