mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
Use new exceptions.
This commit is contained in:
parent
97ff5308fe
commit
87e7ea72a6
8 changed files with 39 additions and 48 deletions
|
@ -543,7 +543,7 @@ listindex(self, args)
|
|||
if (cmpobject(self->ob_item[i], args) == 0)
|
||||
return newintobject(i);
|
||||
}
|
||||
err_setstr(RuntimeError, "list.index(x): x not in list");
|
||||
err_setstr(ValueError, "list.index(x): x not in list");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -586,7 +586,7 @@ listremove(self, args)
|
|||
}
|
||||
|
||||
}
|
||||
err_setstr(RuntimeError, "list.remove(x): x not in list");
|
||||
err_setstr(ValueError, "list.remove(x): x not in list");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue