Skip to content

Commit ce857b0

Browse files
utils: dont break if commonpath throws exception (#1554)
* utils: dont break if commonpath throws exception Signed-off-by: David Korczynski <david@adalogics.com> * narrow to value errors Signed-off-by: DavidKorczynski <david@adalogics.com> --------- Signed-off-by: David Korczynski <david@adalogics.com> Signed-off-by: DavidKorczynski <david@adalogics.com>
1 parent 96e4535 commit ce857b0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/fuzz_introspector/utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ def longest_common_prefix(strs: List[str]) -> str:
3838
Dummy wrapper function for os.path.commonpath(paths: List[str]) -> str
3939
Keeping for backward compactibility
4040
"""
41-
return os.path.commonpath(strs)
41+
try:
42+
return os.path.commonpath(strs)
43+
except ValueError:
44+
return '/'
4245

4346

4447
def normalise_str(s1: str) -> str:

0 commit comments

Comments
 (0)