We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a8d1b70 commit 6879a78Copy full SHA for 6879a78
compdb/utils.py
@@ -70,7 +70,14 @@ def stdout_unicode_writer():
70
71
def get_friendly_path(path):
72
full_path = os.path.normpath(path)
73
- rel_path = os.path.relpath(full_path)
+ try:
74
+ rel_path = os.path.relpath(full_path)
75
+ except ValueError:
76
+ # on Windows, we can get a ValueError
77
+ # if the current directory is on another drive:
78
+ # > ValueError: path is on drive D:, start on drive C:
79
+ # > -- https://github.com/Sarcasm/compdb/issues/16
80
+ return full_path
81
if rel_path.startswith(os.path.join(os.pardir, os.pardir)):
82
friendly_path = full_path
83
else:
0 commit comments