Commit a9e06db8 by Raul Tambre Committed by Commit Bot

Support Python 3 in //scripts/file_exists.py

The changes are to allow build files to be generated using Python 3 on Windows. The scripts still work with Python 2. There are no intended behaviour changes. Bug: 941669 Change-Id: Ia9d8d61373ee37b4470fd5479e9db01e17994ffa Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1520649 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 094c40dc
...@@ -5,18 +5,20 @@ ...@@ -5,18 +5,20 @@
# #
# Simple helper for use in 'gn' files to check if a file exists. # Simple helper for use in 'gn' files to check if a file exists.
from __future__ import print_function
import os, shutil, sys import os, shutil, sys
def main(): def main():
if len(sys.argv) != 2: if len(sys.argv) != 2:
print "Usage: %s <path>" % sys.argv[0] print("Usage: %s <path>" % sys.argv[0])
sys.exit(1) sys.exit(1)
if os.path.exists(sys.argv[1]): if os.path.exists(sys.argv[1]):
print "true" print("true")
else: else:
print "false" print("false")
sys.exit(0) sys.exit(0)
if __name__ == '__main__': if __name__ == '__main__':
main() main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment