[go: nahoru, domu]

blob: 2337e962da1ed175e91a23d102f73664a0915e2a [file] [log] [blame]
Takuto Ikuta3dab32e02023-01-12 18:52:001#!/usr/bin/env python3
Avi Drissman73a09d12022-09-08 20:33:382# Copyright 2014 The Chromium Authors
jochen@chromium.org1731cd42014-03-26 19:10:023# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6"""This program wraps an arbitrary command and prints "1" if the command ran
7successfully."""
8
Raul Tambre9e24293b2019-05-12 06:11:079
jochen@chromium.org29c8539a2014-04-03 07:36:3210import os
jochen@chromium.org1731cd42014-03-26 19:10:0211import subprocess
12import sys
13
jochen@chromium.org29c8539a2014-04-03 07:36:3214devnull = open(os.devnull, 'wb')
15if not subprocess.call(sys.argv[1:], stdout=devnull, stderr=devnull):
Raul Tambre9e24293b2019-05-12 06:11:0716 print(1)
jochen@chromium.org1731cd42014-03-26 19:10:0217else:
Raul Tambre9e24293b2019-05-12 06:11:0718 print(0)