Skip to content
This repository was archived by the owner on Aug 28, 2020. It is now read-only.

Commit 31bc940

Browse files
committed
use find instead of index to not raise ValueError when substring is not found
1 parent 5d87c53 commit 31bc940

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pugdebug/pugdebug.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ def __get_path_mapped_to_local(self, path, map_paths=True):
633633
path_map = get_setting('path/path_mapping')
634634
if (len(path_map) > 0 and
635635
map_paths is True and
636-
path.index(path_map) == 0):
636+
path.find(path_map) == 0):
637637
path = path[len(path_map):]
638638
path = "%s%s" % (self.file_browser.model().rootPath(), path)
639639

@@ -647,7 +647,7 @@ def __get_path_mapped_to_remote(self, path):
647647
path_map = get_setting('path/path_mapping')
648648
root_path = self.file_browser.model().rootPath()
649649

650-
if len(path_map) > 0 and path.index(root_path) == 0:
650+
if len(path_map) > 0 and path.find(root_path) == 0:
651651
path = path[len(root_path):]
652652
path = "%s%s" % (path_map, path)
653653

0 commit comments

Comments
 (0)