Raise an error on negative scroll amounts
This commit is contained in:
parent
2490199e52
commit
19bd068599
1 changed files with 4 additions and 1 deletions
|
|
@ -1336,7 +1336,10 @@ scroll(Screen *self, PyObject *args) {
|
|||
amt = self->historybuf->count;
|
||||
break;
|
||||
default:
|
||||
amt = MAX(0, amt);
|
||||
if (amt < 0) {
|
||||
PyErr_SetString(PyExc_ValueError, "scroll amounts must be positive numbers");
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (!upwards) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue