Make Python code more idiomatic
This commit is contained in:
@@ -357,7 +357,7 @@ Log files will log the path to tracks relative to this directory.
|
||||
logger.debug('ripIfNotRipped: path %r' % path)
|
||||
trackResult.number = number
|
||||
|
||||
assert type(path) is unicode, "%r is not unicode" % path
|
||||
assert isinstance(path, unicode), "%r is not unicode" % path
|
||||
trackResult.filename = path
|
||||
if number > 0:
|
||||
trackResult.pregap = self.itable.tracks[number - 1].getPregap()
|
||||
|
||||
@@ -36,7 +36,7 @@ def main():
|
||||
ret = cmd.do()
|
||||
except SystemError as e:
|
||||
sys.stderr.write('whipper: error: %s\n' % e)
|
||||
if (type(e) is common.EjectError and
|
||||
if (isinstance(e, common.EjectError) and
|
||||
cmd.options.eject in ('failure', 'always')):
|
||||
eject_device(e.device)
|
||||
return 255
|
||||
|
||||
Reference in New Issue
Block a user