Skip to content

Commit e68e73e

Browse files
committed
Make exceptions Python 3 compatible
(Thanks to Andy Seit.)
1 parent 58a185a commit e68e73e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

py/selenium/webdriver/firefox/firefox_profile.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Copyright 2014 Software Freedom Conservancy
12
# Copyright 2008-2011 WebDriver committers
23
# Copyright 2008-2011 Google Inc.
34
#
@@ -340,8 +341,8 @@ def get_text(element):
340341
manifest = f.read()
341342
else:
342343
raise IOError('Add-on path is neither an XPI nor a directory: %s' % addon_path)
343-
except (IOError, KeyError), e:
344-
raise AddonFormatError, str(e), sys.exc_info()[2]
344+
except (IOError, KeyError) as e:
345+
raise AddonFormatError(str(e), sys.exc_info()[2])
345346

346347
try:
347348
doc = minidom.parseString(manifest)
@@ -356,8 +357,8 @@ def get_text(element):
356357
entry = node.nodeName.replace(em, "")
357358
if entry in details.keys():
358359
details.update({entry: get_text(node)})
359-
except Exception, e:
360-
raise AddonFormatError, str(e), sys.exc_info()[2]
360+
except Exception as e:
361+
raise AddonFormatError(str(e), sys.exc_info()[2])
361362

362363
# turn unpack into a true/false value
363364
if isinstance(details['unpack'], basestring):

0 commit comments

Comments
 (0)