run.py 680 B

123456789101112131415161718192021
  1. #!/usr/bin/env python3
  2. # Copyright 2014 the V8 project authors. All rights reserved.
  3. # Use of this source code is governed by a BSD-style license that can be
  4. # found in the LICENSE file.
  5. """This program wraps an arbitrary command since gn currently can only execute
  6. scripts."""
  7. import subprocess
  8. import sys
  9. result = subprocess.call(sys.argv[1:])
  10. if result != 0:
  11. # Windows error codes such as 0xC0000005 and 0xC0000409 are much easier
  12. # to recognize and differentiate in hex.
  13. if result < -100:
  14. # Print negative hex numbers as positive by adding 2^32.
  15. print('Return code is %08X' % (result + 2**32))
  16. else:
  17. print('Return code is %d' % result)
  18. sys.exit(result)