Skip to content

Commit

Permalink
Support Temporary Directory on different Drive
Browse files Browse the repository at this point in the history
If Project and Temporary Directory are located on different
Windows drives (i.e. D:\ and C:\) an exception was thrown
in the past.
  • Loading branch information
mrh1997 committed Sep 12, 2023
1 parent 1229620 commit e6b5e07
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions headlock/integrations/pytest/plugin_headlock_debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,10 @@ def build(self, additonal_c_sources=None):
if master_cmakelist:
master_cmakelist_path = Path(master_cmakelist)
master_cmakelist_dir = master_cmakelist_path.parent.resolve()
rel_build_dir = os.path.relpath(self.build_dir,
str(master_cmakelist_dir))
try:
rel_build_dir = self.build_dir.relative_to(master_cmakelist_dir)
except ValueError:
rel_build_dir = self.build_dir.absolute()
rel_build_dir_str = str(rel_build_dir).replace('\\', '/')
if master_cmakelist_path.exists():
lines = master_cmakelist_path.open().readlines()
Expand Down

0 comments on commit e6b5e07

Please sign in to comment.