Skip to content

Commit

Permalink
bpo-44285: getpath.c: Assert that env_file is NULL during an error ch…
Browse files Browse the repository at this point in the history
…eck (pythonGH-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.
  • Loading branch information
stratakis committed Jun 2, 2021
1 parent fbf25b8 commit bdb5690
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Modules/getpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit bdb5690

Please sign in to comment.