From: Brett Cannon Date: Sun, 13 Apr 2008 00:18:44 +0000 (+0000) Subject: Fix a bug in PySys_HasWarnOption() where it was not properly checking the X-Git-Tag: v2.6a3~208 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=40f0a87666b7a6b76d247e00c7623919feeff1cf;p=thirdparty%2FPython%2Fcpython.git Fix a bug in PySys_HasWarnOption() where it was not properly checking the length of the list storing the warning options. --- diff --git a/Python/sysmodule.c b/Python/sysmodule.c index d6ccd17b5a4b..5293c9740353 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -943,7 +943,7 @@ PySys_AddWarnOption(char *s) int PySys_HasWarnOptions(void) { - return warnoptions ? 1 : 0; + return (warnoptions != NULL && (PyList_Size(warnoptions) > 0)) ? 1 : 0; } /* XXX This doc string is too long to be a single string literal in VC++ 5.0.