Update paginator.py

Use str.startswith('/') to check whether 'ret' starts with a slash. The original code fails when 'ret' is an empty string, such as when INDEX_URL is set to "".
This commit is contained in:
geoffff 2021-12-22 16:23:06 -08:00 committed by Justin Mayer
commit 8bb9e0da48

View file

@ -155,7 +155,7 @@ class Page:
# changed to lstrip() because that would remove all leading slashes and
# thus make the workaround impossible. See
# test_custom_pagination_pattern() for a verification of this.
if ret[0] == '/':
if ret.startswith('/'):
ret = ret[1:]
return ret