Skip to content

Commit 85b587a

Browse files
bpo-44285: getpath.c: Assert that env_file is NULL during an error check (GH-26486) (GH-26496)
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. (cherry picked from commit bdb5690) Co-authored-by: stratakis <[email protected]>
1 parent 9a68862 commit 85b587a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Modules/getpath.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,6 +1263,7 @@ calculate_read_pyenv(PyCalculatePath *calculate)
12631263

12641264
status = calculate_open_pyenv(calculate, &env_file);
12651265
if (_PyStatus_EXCEPTION(status)) {
1266+
assert(env_file == NULL);
12661267
return status;
12671268
}
12681269
if (env_file == NULL) {

0 commit comments

Comments
 (0)