bpo-44285: getpath.c: Assert that env_file is NULL during an error check (GH-26486)

This was flagged by a static analyzer, but the logic of why this is NULL on error is hard to follow for humans as well.
This commit is contained in:
stratakis 2021-06-02 16:54:33 +02:00 committed by GitHub
parent fbf25b8c0d
commit bdb56902a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1263,6 +1263,7 @@ calculate_read_pyenv(PyCalculatePath *calculate)
status = calculate_open_pyenv(calculate, &env_file);
if (_PyStatus_EXCEPTION(status)) {
assert(env_file == NULL);
return status;
}
if (env_file == NULL) {