summaryrefslogtreecommitdiffstats
path: root/build/dir_exists.py
diff options
context:
space:
mode:
authorbratell@opera.com <bratell@opera.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-16 21:52:49 +0000
committerbratell@opera.com <bratell@opera.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-16 21:52:49 +0000
commitdd0ef2ff9d1c8e8002bd34483186c48aeec67de0 (patch)
tree64fb390d345ca90cfedffdb85480ee9fc6ecc0b5 /build/dir_exists.py
parentf0469511a47aeb119f2d7bf45d49d5eb836333ce (diff)
downloadchromium_src-dd0ef2ff9d1c8e8002bd34483186c48aeec67de0.zip
chromium_src-dd0ef2ff9d1c8e8002bd34483186c48aeec67de0.tar.gz
chromium_src-dd0ef2ff9d1c8e8002bd34483186c48aeec67de0.tar.bz2
gyp performance: don't invoke python to check dir existance
We spend a few tenths of a second every gyp invocation starting the dir_exists.py program. Seems a bit unnecessary. BUG=362075 R=scottmg@chromium.org Review URL: https://codereview.chromium.org/234963003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264316 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/dir_exists.py')
-rwxr-xr-xbuild/dir_exists.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/build/dir_exists.py b/build/dir_exists.py
index 0a89bc8..70d367e 100755
--- a/build/dir_exists.py
+++ b/build/dir_exists.py
@@ -8,8 +8,16 @@ import os.path
import sys
def main():
- sys.stdout.write(str(os.path.isdir(sys.argv[1])))
+ sys.stdout.write(_is_dir(sys.argv[1]))
return 0
+def _is_dir(dir_name):
+ return str(os.path.isdir(dir_name))
+
+def DoMain(args):
+ """Hook to be called from gyp without starting a separate python
+ interpreter."""
+ return _is_dir(args[0])
+
if __name__ == '__main__':
sys.exit(main())