diff options
author | cduvall@chromium.org <cduvall@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-17 17:30:50 +0000 |
---|---|---|
committer | cduvall@chromium.org <cduvall@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-17 17:30:50 +0000 |
commit | ad72280a8fbf5c7594ee1cb2f5f17d9634ffe031 (patch) | |
tree | 79e82f8ea9441a2136f1916ad27ebff9c90f93e9 | |
parent | 297daba07a20267c1b2e8e83e4d9c2065c979a79 (diff) | |
download | chromium_src-ad72280a8fbf5c7594ee1cb2f5f17d9634ffe031.zip chromium_src-ad72280a8fbf5c7594ee1cb2f5f17d9634ffe031.tar.gz chromium_src-ad72280a8fbf5c7594ee1cb2f5f17d9634ffe031.tar.bz2 |
Fix c/c/e/docs/server2/PRESUBMIT.py to work with git try
PRESUBMIT.py was throwing an exception when run with git try. Now it works.
BUG=149162
Review URL: https://codereview.chromium.org/10907237
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157143 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/common/extensions/docs/server2/PRESUBMIT.py | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/chrome/common/extensions/docs/server2/PRESUBMIT.py b/chrome/common/extensions/docs/server2/PRESUBMIT.py index 7f92746..59edd64 100644 --- a/chrome/common/extensions/docs/server2/PRESUBMIT.py +++ b/chrome/common/extensions/docs/server2/PRESUBMIT.py @@ -10,11 +10,22 @@ for more details about the presubmit API built into gcl. # Run build_server so that files needed by tests are copied to the local # third_party directory. +import os import sys -sys.path.insert(0, '.') -import build_server -build_server.main() -sys.path.pop(0) +SYS_PATH = sys.path[:] +try: + sys.path.insert(0, '.') + sys.path.insert(0, os.path.join(os.getcwd().split(os.sep + 'src')[0], + 'src', + 'chrome', + 'common', + 'extensions', + 'docs', + 'server2')) + import build_server + build_server.main() +finally: + sys.path = SYS_PATH WHITELIST = [ r'.+_test.py$' ] # The integration tests are selectively run from the PRESUBMIT in |