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:
Raul Tambre
2019-05-24 16:35:35 +00:00
committed by Commit Bot
parent 7d1300b89a
commit 7c93846385
17 changed files with 32 additions and 32 deletions

View File

@@ -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