Skip to content

Commit c1e4343

Browse files
author
brett.cannon
committed
Fix a bug in PySys_HasWarnOption() where it was not properly checking the
length of the list storing the warning options. git-svn-id: http://svn.python.org/projects/python/trunk@62305 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent d27e4fa commit c1e4343

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Python/sysmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@ PySys_AddWarnOption(char *s)
943943
int
944944
PySys_HasWarnOptions(void)
945945
{
946-
return warnoptions ? 1 : 0;
946+
return (warnoptions != NULL && (PyList_Size(warnoptions) > 0)) ? 1 : 0;
947947
}
948948

949949
/* XXX This doc string is too long to be a single string literal in VC++ 5.0.

0 commit comments

Comments
 (0)