pylint R1705(no-else-return)

This commit is contained in:
Carlos Meza 2018-02-25 08:07:31 +00:00
parent 7bdd9bdaa3
commit 4d5732dbd7
3 changed files with 6 additions and 8 deletions

View file

@ -52,9 +52,8 @@ class BasePartition(AbstractPartition):
if self.previous is None:
# Partitions are 1 indexed
return 1
else:
# Recursive call to the previous partition, walking up the chain...
return self.previous.get_index() + 1
# Recursive call to the previous partition, walking up the chain...
return self.previous.get_index() + 1
def get_start(self):
"""Gets the starting byte of this partition
@ -64,8 +63,7 @@ class BasePartition(AbstractPartition):
"""
if self.previous is None:
return Sectors(0, self.size.sector_size)
else:
return self.previous.get_end()
return self.previous.get_end()
def map(self, device_path):
"""Maps the partition to a device_path

View file

@ -22,8 +22,7 @@ class PackageList(object):
"""
if self.target is None:
return self.name
else:
return self.name + '/' + self.target
return self.name + '/' + self.target
class Local(object):
"""A local package

View file

@ -25,12 +25,13 @@ def pick_build_server(build_servers, manifest, preferences={}):
for name, settings in build_servers.iteritems():
if not matches(name, settings):
continue
if settings['type'] == 'local':
if settings['type'] == 'local': # pylint: disable=no-else-return
from .local import LocalBuildServer
return LocalBuildServer(name, settings)
else:
from .remote import RemoteBuildServer
return RemoteBuildServer(name, settings)
raise Exception('Unable to find a build server that matches your preferences.')