From: Guido van Rossum Date: Sun, 11 Aug 2002 14:06:15 +0000 (+0000) Subject: Reset errno to zero after calling PyErr_Warn(). It can potentially do X-Git-Tag: v2.3c1~4548 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3cb8e54da0a3fddd4841ecdbc6a7a79798fcbacd;p=python 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. --- diff --git a/Python/compile.c b/Python/compile.c index e547e03b26..dbff9b03ae 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -1162,6 +1162,7 @@ parsenumber(struct compiling *co, char *s) "will return positive values " "in Python 2.4 and up") < 0) return NULL; + errno = 0; /* Might be changed by PyErr_Warn() */ } } else