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

Side by Side Diff: components/version_ui/PRESUBMIT.py

Issue 2897403003: web_dev_style: actually restore sys.path in various PRESUBMITs (Closed)
Patch Set: Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « components/flags_ui/PRESUBMIT.py ('k') | ui/webui/resources/PRESUBMIT.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2017 The Chromium Authors. All rights reserved. 1 # Copyright 2017 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 5
6 def _CommonChecks(input_api, output_api): 6 def _CommonChecks(input_api, output_api):
7 results = [] 7 results = []
8 try: 8 try:
9 import sys 9 import sys
10 old_sys_path = sys.path 10 old_sys_path = sys.path[:]
11 cwd = input_api.PresubmitLocalPath() 11 cwd = input_api.PresubmitLocalPath()
12 sys.path += [input_api.os_path.join(cwd, '..', '..', 'tools')] 12 sys.path += [input_api.os_path.join(cwd, '..', '..', 'tools')]
13 import web_dev_style.presubmit_support 13 import web_dev_style.presubmit_support
14 results += web_dev_style.presubmit_support.CheckStyle(input_api, output_api) 14 results += web_dev_style.presubmit_support.CheckStyle(input_api, output_api)
15 finally: 15 finally:
16 sys.path = old_sys_path 16 sys.path = old_sys_path
17 return results 17 return results
18 18
19 19
20 def CheckChangeOnUpload(input_api, output_api): 20 def CheckChangeOnUpload(input_api, output_api):
21 return _CommonChecks(input_api, output_api) 21 return _CommonChecks(input_api, output_api)
22 22
23 23
24 def CheckChangeOnCommit(input_api, output_api): 24 def CheckChangeOnCommit(input_api, output_api):
25 return _CommonChecks(input_api, output_api) 25 return _CommonChecks(input_api, output_api)
OLDNEW
« no previous file with comments | « components/flags_ui/PRESUBMIT.py ('k') | ui/webui/resources/PRESUBMIT.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698