Mark pointed out a buglet in his patch: i < _sys_nerr isn't strong

enough, it could be negative.  Add i > 0 test.  (Not i >= 0; zero isn't
a valid error number.)
This commit is contained in:
Guido van Rossum 2000-02-21 16:50:31 +00:00
parent 957d07a159
commit 584b16a1f3
1 changed files with 1 additions and 1 deletions

View File

@ -308,7 +308,7 @@ PyErr_SetFromErrnoWithFilename(exc, filename)
table, we use it, otherwise we assume it really _is_
a Win32 error code
*/
if (i < _sys_nerr) {
if (i > 0 && i < _sys_nerr) {
s = _sys_errlist[i];
}
else {