Skip to content

Commit 054f809

Browse files
committed
util: update suffix logic to modern calls
Replacing use of slices for `removesuffix` calls to improve readability. Signed-off-by: James Knight <git@jdknight.me>
1 parent bc87f4a commit 054f809

File tree

1 file changed

+3
-3
lines changed
  • sphinxcontrib/confluencebuilder

1 file changed

+3
-3
lines changed

sphinxcontrib/confluencebuilder/util.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ def normalize_base_url(url):
7979
if url:
8080
# removing any trailing forward slash user provided
8181
if url.endswith('/'):
82-
url = url[:-1]
82+
url = url.removesuffix('/')
8383
# check for rest api prefix; strip and return if found
8484
if url.endswith(API_REST_V1):
85-
url = url[:-len(API_REST_V1)]
85+
url = url.removesuffix(API_REST_V1)
8686
if url.endswith(API_REST_V2):
87-
url = url[:-len(API_REST_V2)]
87+
url = url.removesuffix(API_REST_V2)
8888
# restore trailing forward flash
8989
elif not url.endswith('/'):
9090
url += '/'

0 commit comments

Comments
 (0)