8000 bpo-44285: getpath.c: Assert that env_file is NULL during an error ch… · python/cpython@0e9af8c · GitHub
[go: up one dir, main page]

Skip to content

Commit 0e9af8c

Browse files
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. (cherry picked from commit bdb5690) Co-authored-by: stratakis <cstratak@redhat.com>
1 parent e5e93e6 commit 0e9af8c

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;
< 42EB /code>
12671268
}
12681269
if (env_file == NULL) {

0 commit comments

Comments
 (0)
0