]> granicus.if.org Git - python/commitdiff
Reset errno to zero after calling PyErr_Warn(). It can potentially do
authorGuido van Rossum <guido@python.org>
Sun, 11 Aug 2002 14:06:15 +0000 (14:06 +0000)
committerGuido van Rossum <guido@python.org>
Sun, 11 Aug 2002 14:06:15 +0000 (14:06 +0000)
a lot of work, including I/O (e.g. to import warnings.py), which might
affect errno.

Python/compile.c

index e547e03b260095cb1b633cd49815ad6861772f25..dbff9b03ae6851ca0a609ca2da731ca82dfdc29f 100644 (file)
@@ -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