fix: handle ValueError in os.path.relpath calls

This commit is contained in:
Paul Gauthier (aider) 2024-09-04 14:10:56 -07:00
parent 937a1cd847
commit 6152a82513
2 changed files with 8 additions and 2 deletions

View file

@ -52,7 +52,10 @@ class Linter:
def get_rel_fname(self, fname):
if self.root:
return os.path.relpath(fname, self.root)
try:
return os.path.relpath(fname, self.root)
except ValueError:
return fname
else:
return fname