summaryrefslogtreecommitdiff
path: root/scss
diff options
context:
space:
mode:
authorWilliam Anderson <william@thewilliamanderson.com>2015-08-04 13:40:01 -0400
committerWilliam Anderson <william@thewilliamanderson.com>2015-08-04 13:40:01 -0400
commit885ef5623c9ae8e71fdf02c17e729fcd8bac24c6 (patch)
tree430310a11b6cef0497a5e7895ab212357a31b1d6 /scss
parent294746c0ea3e3232bc57f65a7af2ae766d868a6f (diff)
downloadpyscss-885ef5623c9ae8e71fdf02c17e729fcd8bac24c6.tar.gz
Fixes length calculation for str_slice edge cases
Diffstat (limited to 'scss')
-rw-r--r--scss/extension/core.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/scss/extension/core.py b/scss/extension/core.py
index c1bdd53..7967429 100644
--- a/scss/extension/core.py
+++ b/scss/extension/core.py
@@ -578,11 +578,11 @@ def str_slice(string, start_at, end_at=None):
expect_type(start_at, Number, unit=None)
if int(start_at) == 0:
- py_start_at = 1
+ py_start_at = 0
else:
py_start_at = start_at.to_python_index(len(string.value))
- if end_at is None or int(end_at) > len(string):
+ if end_at is None or int(end_at) > len(string.value):
py_end_at = None
else:
expect_type(end_at, Number, unit=None)