From 46351669c279764e1b070943366d7c0ea84a243a Mon Sep 17 00:00:00 2001 From: "thestig@chromium.org" Date: Mon, 13 Apr 2009 23:19:35 +0000 Subject: Build pipeline directly in build/action_maketokenizer.py. Review URL: http://codereview.chromium.org/67086 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13631 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/build/action_maketokenizer.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'webkit/build') diff --git a/webkit/build/action_maketokenizer.py b/webkit/build/action_maketokenizer.py index 1823495..0c45265 100755 --- a/webkit/build/action_maketokenizer.py +++ b/webkit/build/action_maketokenizer.py @@ -55,17 +55,19 @@ def main(args): maketokenizer = inputs[0] flex_input = inputs[1] - # Build up the command. - command = 'flex -t %s | perl %s > %s' % (flex_input, maketokenizer, output) - # Do it. check_call is new in 2.5, so simulate its behavior with call and # assert. - # TODO(mark): Don't use shell=True, build up the pipeline directly. - p = subprocess.Popen(command, shell=True) - return_code = p.wait() - assert return_code == 0 + outfile = open(output, 'wb') + p1 = subprocess.Popen(['flex', '-t', flex_input], stdout=subprocess.PIPE) + p2 = subprocess.Popen(['perl', maketokenizer], stdin=p1.stdout, + stdout=outfile) + + r1 = p1.wait() + r2 = p2.wait() + assert r1 == 0 + assert r2 == 0 - return return_code + return 0 if __name__ == '__main__': -- cgit v1.1