Mercurial > cpython-lru_cache-weakref
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 46415:f781ca14395b | 46416:39ea2fc4503d |
|---|---|
| 941 } | 941 } |
| 942 | 942 |
| 943 int | 943 int |
| 944 PySys_HasWarnOptions(void) | 944 PySys_HasWarnOptions(void) |
| 945 { | 945 { |
| 946 return warnoptions ? 1 : 0; | 946 return (warnoptions != NULL && (PyList_Size(warnoptions) > 0)) ? 1 : 0; |
| 947 } | 947 } |
| 948 | 948 |
| 949 /* XXX This doc string is too long to be a single string literal in VC++ 5.0. | 949 /* XXX This doc string is too long to be a single string literal in VC++ 5.0. |
| 950 Two literals concatenated works just fine. If you have a K&R compiler | 950 Two literals concatenated works just fine. If you have a K&R compiler |
| 951 or other abomination that however *does* understand longer strings, | 951 or other abomination that however *does* understand longer strings, |
