Skip to content

[2.13+3.0] Use string startswith() and endswith() methods

... instead of slicing to check for prefixes and suffixes.

This change prevents a crash in aa-mergeprof - if replacement is empty, trying to access replacement[0] causes an IndexError. Using .startswith() works without crashing.

This backports parts of the severity.py changes in commit 091c6ad5 by Mark Grassi.

I propose this fix for 2.13 and 3.0. (3.1 and master already have this fix.)

Merge request reports