commit:     28ed2fe28888ba42c7e58cb79e7ce991025e6a96
Author:     Aaron Bauman <bman <AT> gentoo <DOT> org>
AuthorDate: Fri Aug  7 19:06:04 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Aug  7 20:03:29 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=28ed2fe2

lib/*: Fix useless-return

* Python implies such things. Let's drop 'em and be consistent.

Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/_emerge/EbuildPhase.py     | 1 -
 lib/_emerge/resolver/output.py | 5 -----
 lib/portage/elog/mod_custom.py | 1 -
 lib/portage/elog/mod_echo.py   | 1 -
 lib/portage/elog/mod_mail.py   | 2 --
 lib/portage/glsa.py            | 3 ---
 lib/portage/mail.py            | 1 -
 lib/portage/sync/controller.py | 1 -
 lib/portage/util/whirlpool.py  | 2 --
 pylintrc                       | 1 +
 10 files changed, 1 insertion(+), 17 deletions(-)

diff --git a/lib/_emerge/EbuildPhase.py b/lib/_emerge/EbuildPhase.py
index e6256d0aa..4bc2749bd 100644
--- a/lib/_emerge/EbuildPhase.py
+++ b/lib/_emerge/EbuildPhase.py
@@ -396,7 +396,6 @@ class EbuildPhase(CompositeTask):
                        fd_pipes=self.fd_pipes, phase=phase, 
scheduler=self.scheduler,
                        settings=self.settings)
                self._start_task(clean_phase, self._fail_clean_exit)
-               return
 
        def _fail_clean_exit(self, clean_phase):
                self._final_exit(clean_phase)

diff --git a/lib/_emerge/resolver/output.py b/lib/_emerge/resolver/output.py
index 1dcb47020..b6c77ecad 100644
--- a/lib/_emerge/resolver/output.py
+++ b/lib/_emerge/resolver/output.py
@@ -243,7 +243,6 @@ class Display:
                                cur_use_map[key], old_iuse_map[key],
                                old_use_map[key], is_new, feature_flags,
                                reinst_flags_map.get(key))
-               return
 
 
        @staticmethod
@@ -539,7 +538,6 @@ class Display:
                        if show_repos and repoadd:
                                myprint += " " + teal("[%s]" % repoadd)
                        writemsg_stdout("%s\n" % (myprint,), noiselevel=-1)
-               return
 
 
        def print_blockers(self):
@@ -548,7 +546,6 @@ class Display:
                """
                for pkg in self.blockers:
                        writemsg_stdout("%s\n" % (pkg,), noiselevel=-1)
-               return
 
 
        def print_verbose(self, show_repos):
@@ -562,7 +559,6 @@ class Display:
                        # that RepoDisplay.__unicode__() is called in python2.
                        writemsg_stdout("%s" % (self.conf.repo_display,),
                                noiselevel=-1)
-               return
 
 
        def print_changelog(self):
@@ -687,7 +683,6 @@ class Display:
                        if ebuild_path_cl is not None:
                                self.changelogs.extend(_calc_changelog(
                                        ebuild_path_cl, pkg_info.previous_pkg, 
pkg.cpv))
-               return
 
 
        def check_system_world(self, pkg):

diff --git a/lib/portage/elog/mod_custom.py b/lib/portage/elog/mod_custom.py
index 7cfafeccc..aaf1d3b1b 100644
--- a/lib/portage/elog/mod_custom.py
+++ b/lib/portage/elog/mod_custom.py
@@ -18,4 +18,3 @@ def process(mysettings, key, logentries, fulltext):
                retval = portage.process.spawn_bash(mylogcmd)
                if retval != 0:
                        raise portage.exception.PortageException("!!! 
PORTAGE_ELOG_COMMAND failed with exitcode %d" % retval)
-       return

diff --git a/lib/portage/elog/mod_echo.py b/lib/portage/elog/mod_echo.py
index 80f2b11ac..dc9edd201 100644
--- a/lib/portage/elog/mod_echo.py
+++ b/lib/portage/elog/mod_echo.py
@@ -61,4 +61,3 @@ def _finalize():
                                for line in msgcontent:
                                        fmap[msgtype](line.strip("\n"))
        _items = []
-       return

diff --git a/lib/portage/elog/mod_mail.py b/lib/portage/elog/mod_mail.py
index 38eaa277f..f737a80ce 100644
--- a/lib/portage/elog/mod_mail.py
+++ b/lib/portage/elog/mod_mail.py
@@ -41,5 +41,3 @@ def process(mysettings, key, logentries, fulltext):
                portage.mail.send_mail(mysettings, mymessage)
        except PortageException as e:
                writemsg("%s\n" % str(e), noiselevel=-1)
-
-       return

diff --git a/lib/portage/glsa.py b/lib/portage/glsa.py
index 9260e7e09..1870d9338 100644
--- a/lib/portage/glsa.py
+++ b/lib/portage/glsa.py
@@ -492,7 +492,6 @@ class Glsa:
                finally:
                        f.close()
 
-               return None
 
        def parse(self, myfile):
                """
@@ -583,7 +582,6 @@ class Glsa:
                        self.packages[name].append(tmp)
                # TODO: services aren't really used yet
                self.services = self.affected.getElementsByTagName("service")
-               return None
 
        def dump(self, outstream=sys.stdout, encoding="utf-8"):
                """
@@ -684,7 +682,6 @@ class Glsa:
                                mode='a+', encoding=_encodings['content'], 
errors='strict')
                        checkfile.write(_unicode_decode(self.nr + "\n"))
                        checkfile.close()
-               return None
 
        def getMergeList(self, least_change=True):
                """

diff --git a/lib/portage/mail.py b/lib/portage/mail.py
index 6503b4cc9..f4fccd8c2 100644
--- a/lib/portage/mail.py
+++ b/lib/portage/mail.py
@@ -136,4 +136,3 @@ def send_mail(mysettings, message):
                        raise portage.exception.PortageException(_("!!! An 
error occurred while trying to send logmail:\n")+str(e))
                except socket.error as e:
                        raise portage.exception.PortageException(_("!!! A 
network error occurred while trying to send logmail:\n%s\nSure you configured 
PORTAGE_ELOG_MAILURI correctly?") % str(e))
-       return

diff --git a/lib/portage/sync/controller.py b/lib/portage/sync/controller.py
index cb68e2c37..0f42b1da9 100644
--- a/lib/portage/sync/controller.py
+++ b/lib/portage/sync/controller.py
@@ -184,7 +184,6 @@ class SyncManager:
                        writemsg_level(msg + "\n")
                if self.callback:
                        self.callback(exitcode, updatecache_flg)
-               return
 
 
        def perform_post_sync_hook(self, reponame, dosyncuri='', 
repolocation=''):

diff --git a/lib/portage/util/whirlpool.py b/lib/portage/util/whirlpool.py
index 1071d5155..857abf3ac 100644
--- a/lib/portage/util/whirlpool.py
+++ b/lib/portage/util/whirlpool.py
@@ -634,7 +634,6 @@ class WhirlpoolStruct:
 
 def WhirlpoolInit(ctx):
     ctx = WhirlpoolStruct()
-    return
 
 def WhirlpoolAdd(source, sourceBits, ctx):
     if not isinstance(source, bytes):
@@ -777,7 +776,6 @@ def processBuffer(ctx):
     # apply the Miyaguchi-Preneel compression function
     for i in range(8):
         ctx.hash[i] ^= state[i] ^ block[i]
-    return
 
 #
 # Tests.

diff --git a/pylintrc b/pylintrc
index f2aadf14f..ce5dec11b 100644
--- a/pylintrc
+++ b/pylintrc
@@ -33,6 +33,7 @@ enable=
         unused-import,
         useless-import-alias,
         useless-object-inheritance,
+        useless-return,
         wildcard-import
 
 # A comma-separated list of package or module names from where C extensions may

Reply via email to