diff --git a/bin/Lib/SPython/SPythonSystem.pas b/bin/Lib/SPython/SPythonSystem.pas index 6c0a15b2b..91e4bf471 100644 --- a/bin/Lib/SPython/SPythonSystem.pas +++ b/bin/Lib/SPython/SPythonSystem.pas @@ -634,7 +634,7 @@ function float(x: integer): real := PABCSystem.Floor(x); function range(s: integer; e: integer; step: integer): sequence of integer; begin - Result := PABCSystem.Range(s, e - 1, step); + Result := PABCSystem.Range(s, e - PABCSystem.Sign(step), step); end; function range(s: integer; e: integer): sequence of integer;