A few more eradications of plain strings.

pull/102/head
Jussi Pakkanen 10 years ago
parent 8cecf20404
commit 5bebe6ce14
  1. 3
      backends.py
  2. 2
      interpreter.py
  3. 4
      ninjabackend.py

@ -165,10 +165,9 @@ class Backend():
targetdir = self.get_target_private_dir(extobj.target)
suffix = '.' + self.environment.get_object_suffix()
for osrc in extobj.srclist:
osrc = osrc.fname
if not self.source_suffix_in_objs:
osrc = '.'.join(osrc.split('.')[:-1])
if hasattr(osrc, 'fname'): # FIXME allow only strings.
osrc = osrc.fname
objname = os.path.join(proj_dir_to_build_root,
targetdir, os.path.basename(osrc) + suffix)
result.append(objname)

@ -1490,7 +1490,7 @@ class Interpreter():
if isinstance(s, File) or isinstance(s, GeneratedListHolder) or \
isinstance(s, CustomTargetHolder):
pass
elif isinstance(s, str): # FIXME do not allow plain strings.
elif isinstance(s, str):
s = File.from_source_file(self.environment.source_dir, self.subdir, s)
else:
raise RuntimeError("Unreachable code")

@ -1107,10 +1107,10 @@ rule FORTRAN_DEP_HACK
rel_src = os.path.join(self.get_target_private_dir(target), src)
abs_src = os.path.join(self.environment.get_source_dir(), rel_src)
else:
if isinstance(src, File): # FIXME, accept only Files.
if isinstance(src, File):
rel_src = src.rel_to_builddir(self.build_to_src)
else:
rel_src = os.path.join(self.build_to_src, target.get_source_subdir(), src)
raise build.InvaliArguments('Invalid source type.')
abs_src = os.path.join(self.environment.get_build_dir(), rel_src)
if isinstance(src, RawFilename):
src_filename = src.fname

Loading…
Cancel
Save