backends: avoid extraneous trailing os.path.sep when joining paths
resolves
@@ -162,8 +162,11 @@ class Backend:
return os.path.relpath(target_dir, othert_dir)
def get_target_source_dir(self, target):
- dirname = os.path.join(self.build_to_src, self.get_target_dir(target))
- return dirname
+ # if target dir is empty, avoid extraneous trailing / from os.path.join()
+ target_dir = self.get_target_dir(target)
+ if target_dir:
+ return os.path.join(self.build_to_src, target_dir)
+ return self.build_to_src
def get_target_private_dir(self, target):
dirname = os.path.join(self.get_target_dir(target), target.get_basename() + target.type_suffix())
