diff Python/sysmodule.c @ 46416:39ea2fc4503d legacy-trunk

Fix a bug in PySys_HasWarnOption() where it was not properly checking the length of the list storing the warning options.
author Brett Cannon <bcannon@gmail.com>
date Sun, 13 Apr 2008 00:18:44 +0000
parents 840064802952
children fb8d3e1f6161
line wrap: on
line diff
--- a/Python/sysmodule.c	Sun Apr 13 00:03:25 2008 +0000
+++ b/Python/sysmodule.c	Sun Apr 13 00:18:44 2008 +0000
@@ -943,7 +943,7 @@
 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.