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

Unified Diff: gcl.py

Issue 130493002: Handle the PrimeLint SSL read timeout better. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Add 'ssl' to tests/gcl_unittests.py Created 6 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 | tests/gcl_unittest.py » ('j') | tests/gcl_unittest.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gcl.py
diff --git a/gcl.py b/gcl.py
index db1e5b3eb9b46e8db34b509014beeb631b84cb6b..1249480d28e006b7f5008bd81668c1a03bd53729 100755
--- a/gcl.py
+++ b/gcl.py
@@ -13,6 +13,7 @@ import optparse
import os
import random
import re
+import ssl
import string
import sys
import tempfile
@@ -400,8 +401,14 @@ class ChangeInfo(object):
"""Do background work on Rietveld to lint the file so that the results are
ready when the issue is viewed."""
if self.issue and self.patchset:
- self.SendToRietveld('/lint/issue%s_%s' % (self.issue, self.patchset),
- timeout=10)
+ try:
+ self.SendToRietveld('/lint/issue%s_%s' % (self.issue, self.patchset),
+ timeout=10)
+ except ssl.SSLError as e:
+ # It takes more than 10 seconds to lint some CLs. Silently ignore
+ # the expected timeout.
+ if e.message != 'The read operation timed out':
+ raise
def SendToRietveld(self, request_path, timeout=None, **kwargs):
"""Send a POST/GET to Rietveld. Returns the response body."""
« no previous file with comments | « no previous file | tests/gcl_unittest.py » ('j') | tests/gcl_unittest.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698