From 6485f04c165e3d1adf8ab8bc47d58b93a31a931c Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Wed, 9 May 2018 21:01:00 +0530 Subject: introspect: Fix listing target files that are File objects --- mesonbuild/mintro.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'mesonbuild') diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py index 5a9d4cf..81c70ed 100644 --- a/mesonbuild/mintro.py +++ b/mesonbuild/mintro.py @@ -21,6 +21,7 @@ project files and don't need this info.""" import json from . import build, mtest, coredata as cdata +from . import mesonlib from .backend import ninjabackend import argparse import sys, os @@ -118,8 +119,12 @@ def list_target_files(target_name, coredata, builddata): except KeyError: print("Unknown target %s." % target_name) sys.exit(1) - sources = [os.path.join(i.subdir, i.fname) for i in sources] - print(json.dumps(sources)) + out = [] + for i in sources: + if isinstance(i, mesonlib.File): + i = os.path.join(i.subdir, i.fname) + out.append(i) + print(json.dumps(out)) def list_buildoptions(coredata, builddata): optlist = [] -- cgit v1.1