Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Unified Diff: ceee/PRESUBMIT.py

Issue 6299001: Syntax checker for policy_templates.json (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/app/policy
Patch Set: address more comments Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/app/policy/PRESUBMIT.py » ('j') | chrome/app/policy/PRESUBMIT.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ceee/PRESUBMIT.py
diff --git a/ceee/PRESUBMIT.py b/ceee/PRESUBMIT.py
index 17aeddac36f7bde498d8141b0145d5fa6858df0a..7ca80a296a5469a6600bf9da58750bbbb736a9f4 100644
--- a/ceee/PRESUBMIT.py
+++ b/ceee/PRESUBMIT.py
@@ -2,7 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import os
import sys
@@ -10,11 +9,19 @@ def CheckChange(input_api, output_api, committing):
# We need to change the path so that we can import ceee_presubmit
# which lies at the root of the ceee folder. And we do it here so that
# it doesn't pollute all the cases where we get imported yet not called.
- sys.path.append(os.path.join(input_api.PresubmitLocalPath(), '../ceee'))
- import ceee_presubmit
- return ceee_presubmit.CheckChange(input_api,
- output_api,
- committing)
+ old_sys_path = sys.path
+ try:
+ sys.path = ([input_api.os_path.join(input_api.PresubmitLocalPath(),
M-A Ruel 2011/01/18 16:06:23 nit: I think you should create a named variable si
Jakob Kummerow 2011/01/18 16:33:54 Done.
+ '../ceee')] +
+ sys.path)
+ import ceee_presubmit
+ result = ceee_presubmit.CheckChange(input_api,
M-A Ruel 2011/01/18 16:06:23 you can return here, the finally clause will still
Jakob Kummerow 2011/01/18 16:33:54 Done.
+ output_api,
+ committing)
+ finally:
+ sys.path = old_sys_path
+ return result
+
def CheckChangeOnUpload(input_api, output_api):
« no previous file with comments | « no previous file | chrome/app/policy/PRESUBMIT.py » ('j') | chrome/app/policy/PRESUBMIT.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698