Skip to content

Commit

Permalink
Make exceptions Python 3 compatible
Browse files Browse the repository at this point in the history
(Thanks to Andy Seit.)
  • Loading branch information
andreastt committed May 23, 2014
1 parent 58a185a commit e68e73e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions py/selenium/webdriver/firefox/firefox_profile.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2014 Software Freedom Conservancy
# Copyright 2008-2011 WebDriver committers
# Copyright 2008-2011 Google Inc.
#
Expand Down Expand Up @@ -340,8 +341,8 @@ def get_text(element):
manifest = f.read()
else:
raise IOError('Add-on path is neither an XPI nor a directory: %s' % addon_path)
except (IOError, KeyError), e:
raise AddonFormatError, str(e), sys.exc_info()[2]
except (IOError, KeyError) as e:
raise AddonFormatError(str(e), sys.exc_info()[2])

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

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

0 comments on commit e68e73e

Please sign in to comment.