From 60bde6da6e25aae828a4350c4719c32d9c5b7ed6 Mon Sep 17 00:00:00 2001 From: Jeremy Dubreil Date: Tue, 19 Feb 2019 15:36:25 -0800 Subject: [PATCH] [infer][java] no longer fail when the Java Buck target has no output Reviewed By: mbouaziz Differential Revision: D14139656 fbshipit-source-id: 0d645d4d6 --- infer/lib/python/inferlib/bucklib.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/infer/lib/python/inferlib/bucklib.py b/infer/lib/python/inferlib/bucklib.py index 32085cbf5..a81b20954 100644 --- a/infer/lib/python/inferlib/bucklib.py +++ b/infer/lib/python/inferlib/bucklib.py @@ -129,8 +129,10 @@ def get_output_jars(buck_args, targets): else: targets_output = subprocess.check_output( ['buck', 'targets', '--show-output'] + targets) - targets_jars = [entry.split()[1] for entry in - targets_output.decode().strip().split('\n')] + parsed_output = ( + entry.split() + for entry in targets_output.decode().strip().split('\n')) + targets_jars = (p[1] for p in parsed_output if len(p) > 1) return filter(os.path.isfile, targets_jars)