summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2008-04-13 00:18:44 (GMT)
committerBrett Cannon <bcannon@gmail.com>2008-04-13 00:18:44 (GMT)
commit40f0a87666b7a6b76d247e00c7623919feeff1cf (patch)
tree95331df597ef3f1a72c9f6d78776b4dfd7193c8f /Python/sysmodule.c
parentb2693e007b4f0f85b24ec0ebefd75df73dbbd2be (diff)
downloadcpython-40f0a87666b7a6b76d247e00c7623919feeff1cf.zip
cpython-40f0a87666b7a6b76d247e00c7623919feeff1cf.tar.gz
cpython-40f0a87666b7a6b76d247e00c7623919feeff1cf.tar.bz2
Fix a bug in PySys_HasWarnOption() where it was not properly checking the
length of the list storing the warning options.
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index d6ccd17..5293c97 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.