Base.py sync_folder_structure returns always None

The function sync_folder_structure is only used in the accounts.py file:

kix@inle:~/src/offlineimap3/offlineimap$ rgrep sync_folder_structure *
accounts.py:            remoterepos.sync_folder_structure(localrepos, statusrepos)
repository/Base.py:    def sync_folder_structure(self, local_repo, status_repo):
kix@inle:~/src/offlineimap3/offlineimap$

The returned value is not used. We have this warning:

R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)

Because is not returning anything here, but is returning None at the function end.
We can include this None here safely.
This commit is contained in:
Rodolfo García Peñas (kix) 2020-11-01 10:00:02 +01:00
parent 1d93f90db5
commit b175f7a698

View File

@ -258,7 +258,7 @@ class BaseRepository(CustomConfig.ConfigHelperMixin):
if not self.should_create_folders()\
and not local_repo.should_create_folders():
# Quick exit if no folder creation is enabled on either side.
return
return None
remote_repo = self
remote_hash, local_hash = {}, {}