mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +00:00
os.path.commonprefix is suitable for any strings
This commit is contained in:
parent
97fe5714e2
commit
0d2b454b6e
@ -41,7 +41,6 @@ def mark_active_menuitem(menu, path):
|
|||||||
urlitem['active'] = False
|
urlitem['active'] = False
|
||||||
if not path.startswith(str(urlitem['url'])):
|
if not path.startswith(str(urlitem['url'])):
|
||||||
continue
|
continue
|
||||||
# TODO: use a more suitable function instead of os.path.commonprefix
|
|
||||||
match = os.path.commonprefix([urlitem['url'], path])
|
match = os.path.commonprefix([urlitem['url'], path])
|
||||||
|
|
||||||
if len(match) > len(best_match):
|
if len(match) > len(best_match):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user