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

Side by Side Diff: build/android/pylib/ports.py

Issue 132463007: Enable presubmit pylint in build/android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase vs tot and only disabling F0401 in specific spots Created 6 years, 10 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 | « build/android/pylib/pexpect.py ('k') | build/android/pylib/screenshot.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 (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 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 """Functions that deal with local and device ports.""" 5 """Functions that deal with local and device ports."""
6 6
7 import contextlib 7 import contextlib
8 import fcntl 8 import fcntl
9 import httplib 9 import httplib
10 import logging 10 import logging
11 import os 11 import os
12 import re 12 import re
13 import socket 13 import socket
14 import traceback 14 import traceback
15 15
16 import cmd_helper 16 from pylib import cmd_helper
17 import constants 17 from pylib import constants
18 18
19 19
20 # The following two methods are used to allocate the port source for various 20 # The following two methods are used to allocate the port source for various
21 # types of test servers. Because some net-related tests can be run on shards at 21 # types of test servers. Because some net-related tests can be run on shards at
22 # same time, it's important to have a mechanism to allocate the port 22 # same time, it's important to have a mechanism to allocate the port
23 # process-safe. In here, we implement the safe port allocation by leveraging 23 # process-safe. In here, we implement the safe port allocation by leveraging
24 # flock. 24 # flock.
25 def ResetTestServerPortAllocation(): 25 def ResetTestServerPortAllocation():
26 """Resets the port allocation to start from TEST_SERVER_PORT_FIRST. 26 """Resets the port allocation to start from TEST_SERVER_PORT_FIRST.
27 27
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 client_error = ('Bad response: %s %s version %s\n ' % 167 client_error = ('Bad response: %s %s version %s\n ' %
168 (r.status, r.reason, r.version) + 168 (r.status, r.reason, r.version) +
169 '\n '.join([': '.join(h) for h in r.getheaders()])) 169 '\n '.join([': '.join(h) for h in r.getheaders()]))
170 except (httplib.HTTPException, socket.error) as e: 170 except (httplib.HTTPException, socket.error) as e:
171 # Probably too quick connecting: try again. 171 # Probably too quick connecting: try again.
172 exception_error_msgs = traceback.format_exception_only(type(e), e) 172 exception_error_msgs = traceback.format_exception_only(type(e), e)
173 if exception_error_msgs: 173 if exception_error_msgs:
174 client_error = ''.join(exception_error_msgs) 174 client_error = ''.join(exception_error_msgs)
175 # Only returns last client_error. 175 # Only returns last client_error.
176 return (False, client_error or 'Timeout') 176 return (False, client_error or 'Timeout')
OLDNEW
« no previous file with comments | « build/android/pylib/pexpect.py ('k') | build/android/pylib/screenshot.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698