Skip to content

Commit b0aad13

Browse files
committed
py3k: Use new-style exception syntax in fwfetcher.
Signed-off-by: Elliott Sales de Andrade <[email protected]>
1 parent a548000 commit b0aad13

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/fwfetcher.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ def do_mkdir(dirname):
8989

9090
try:
9191
os.mkdir(dirname)
92-
except OSError, (errno):
93-
if errno == 17:
94-
pass # directory already exists
92+
except OSError as e:
93+
if e.errno == 17:
94+
pass # directory already exists
9595

9696
###############################################################################
9797

@@ -518,13 +518,13 @@ def getFileOrURL(filename, url):
518518
print("Found", filename, "cached on disk, using local copy")
519519
retval = f.read()
520520
return retval
521-
except IOError, e:
521+
except IOError:
522522
pass
523523
print("Downloading", filename, "from", url)
524524
req = Request(url)
525525
try:
526526
response = urlopen(req)
527-
except URLError, e:
527+
except URLError as e:
528528
if hasattr(e, 'reason'):
529529
print("Failed to reach download server. Reason:", e.reason)
530530
elif hasattr(e, 'code'):

0 commit comments

Comments
 (0)