Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3cb8e54

Browse files
committed
Reset errno to zero after calling PyErr_Warn(). It can potentially do
a lot of work, including I/O (e.g. to import warnings.py), which might affect errno.
1 parent 643d59c commit 3cb8e54

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Python/compile.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,6 +1162,7 @@ parsenumber(struct compiling *co, char *s)
11621162
"will return positive values "
11631163
"in Python 2.4 and up") < 0)
11641164
return NULL;
1165+
errno = 0; /* Might be changed by PyErr_Warn() */
11651166
}
11661167
}
11671168
else

0 commit comments

Comments
 (0)