mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
Convert except statements to be Python 3 compatible
Ran "2to3 -w -n -f except ./". The scripts still work with Python 2. There are no intended behaviour changes. Bug: 942522 Change-Id: Ifa274cb83f74cfa8ce092fffbb88f3ab5309e72c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1607841 Commit-Queue: Raul Tambre <raul@tambre.ee> Auto-Submit: Raul Tambre <raul@tambre.ee> Reviewed-by: Dirk Pranke <dpranke@chromium.org>
This commit is contained in:
@@ -62,7 +62,7 @@ class Watchlists(object):
|
||||
contents = watchlists_file.read()
|
||||
watchlists_file.close()
|
||||
return contents
|
||||
except IOError, e:
|
||||
except IOError as e:
|
||||
logging.error("Cannot read %s: %s" % (self._GetRulesFilePath(), e))
|
||||
return ''
|
||||
|
||||
@@ -75,7 +75,7 @@ class Watchlists(object):
|
||||
watchlists_data = None
|
||||
try:
|
||||
watchlists_data = eval(contents, {'__builtins__': None}, None)
|
||||
except SyntaxError, e:
|
||||
except SyntaxError as e:
|
||||
logging.error("Cannot parse %s. %s" % (self._GetRulesFilePath(), e))
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user