Fixed compatibility issue regarding Python 3.5

In Python 3.5 os.path.join accepts str or bytes, not path-like
objects as in Python 3.6.
pull/3115/head
makise-homura 7 years ago
parent 3b254c6e49
commit 942e34241f
  1. 2
      mesonbuild/backend/ninjabackend.py

@ -1166,7 +1166,7 @@ int dummy;
abs_vala_file = os.path.join(self.environment.get_build_dir(), vala_file) abs_vala_file = os.path.join(self.environment.get_build_dir(), vala_file)
if PurePath(os.path.commonpath((abs_srcbasedir, abs_vala_file))) == PurePath(abs_srcbasedir): if PurePath(os.path.commonpath((abs_srcbasedir, abs_vala_file))) == PurePath(abs_srcbasedir):
vala_c_subdir = PurePath(abs_vala_file).parent.relative_to(abs_srcbasedir) vala_c_subdir = PurePath(abs_vala_file).parent.relative_to(abs_srcbasedir)
vala_c_file = os.path.join(vala_c_subdir, vala_c_file) vala_c_file = os.path.join(str(vala_c_subdir), vala_c_file)
else: else:
path_to_target = os.path.join(self.build_to_src, target.get_subdir()) path_to_target = os.path.join(self.build_to_src, target.get_subdir())
if vala_file.startswith(path_to_target): if vala_file.startswith(path_to_target):

Loading…
Cancel
Save