[Python-Modernize] libmodernize.fixes.fix_raise
This commit is contained in:
parent
38bc5d07f0
commit
7cdedbea1f
|
@ -72,7 +72,7 @@ class Win32IcoFile (object):
|
||||||
|
|
||||||
header = struct.unpack('<3H', buf.read(6))
|
header = struct.unpack('<3H', buf.read(6))
|
||||||
if (0, 1) != header[:2]:
|
if (0, 1) != header[:2]:
|
||||||
raise SyntaxError, 'not an ico file'
|
raise SyntaxError('not an ico file')
|
||||||
|
|
||||||
self.nb_items = header[2]
|
self.nb_items = header[2]
|
||||||
|
|
||||||
|
|
|
@ -364,7 +364,7 @@ class TrackerIcons(Component):
|
||||||
:rtype: Deferred
|
:rtype: Deferred
|
||||||
"""
|
"""
|
||||||
if len(icons) == 0:
|
if len(icons) == 0:
|
||||||
raise NoIconsError, "empty icons list"
|
raise NoIconsError("empty icons list")
|
||||||
(url, mimetype) = icons.pop(0)
|
(url, mimetype) = icons.pop(0)
|
||||||
d = download_file(url, os.path.join(self.dir, host_to_icon_name(host, mimetype)),
|
d = download_file(url, os.path.join(self.dir, host_to_icon_name(host, mimetype)),
|
||||||
force_filename=True)
|
force_filename=True)
|
||||||
|
@ -392,7 +392,7 @@ class TrackerIcons(Component):
|
||||||
raise InvalidIconError(ex)
|
raise InvalidIconError(ex)
|
||||||
else:
|
else:
|
||||||
if os.stat(icon_name).st_size == 0L:
|
if os.stat(icon_name).st_size == 0L:
|
||||||
raise InvalidIconError, "empty icon"
|
raise InvalidIconError("empty icon")
|
||||||
|
|
||||||
return icon_name
|
return icon_name
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue