1 |
commit: 28ed2fe28888ba42c7e58cb79e7ce991025e6a96 |
2 |
Author: Aaron Bauman <bman <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Aug 7 19:06:04 2020 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Aug 7 20:03:29 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=28ed2fe2 |
7 |
|
8 |
lib/*: Fix useless-return |
9 |
|
10 |
* Python implies such things. Let's drop 'em and be consistent. |
11 |
|
12 |
Signed-off-by: Aaron Bauman <bman <AT> gentoo.org> |
13 |
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org> |
14 |
|
15 |
lib/_emerge/EbuildPhase.py | 1 - |
16 |
lib/_emerge/resolver/output.py | 5 ----- |
17 |
lib/portage/elog/mod_custom.py | 1 - |
18 |
lib/portage/elog/mod_echo.py | 1 - |
19 |
lib/portage/elog/mod_mail.py | 2 -- |
20 |
lib/portage/glsa.py | 3 --- |
21 |
lib/portage/mail.py | 1 - |
22 |
lib/portage/sync/controller.py | 1 - |
23 |
lib/portage/util/whirlpool.py | 2 -- |
24 |
pylintrc | 1 + |
25 |
10 files changed, 1 insertion(+), 17 deletions(-) |
26 |
|
27 |
diff --git a/lib/_emerge/EbuildPhase.py b/lib/_emerge/EbuildPhase.py |
28 |
index e6256d0aa..4bc2749bd 100644 |
29 |
--- a/lib/_emerge/EbuildPhase.py |
30 |
+++ b/lib/_emerge/EbuildPhase.py |
31 |
@@ -396,7 +396,6 @@ class EbuildPhase(CompositeTask): |
32 |
fd_pipes=self.fd_pipes, phase=phase, scheduler=self.scheduler, |
33 |
settings=self.settings) |
34 |
self._start_task(clean_phase, self._fail_clean_exit) |
35 |
- return |
36 |
|
37 |
def _fail_clean_exit(self, clean_phase): |
38 |
self._final_exit(clean_phase) |
39 |
|
40 |
diff --git a/lib/_emerge/resolver/output.py b/lib/_emerge/resolver/output.py |
41 |
index 1dcb47020..b6c77ecad 100644 |
42 |
--- a/lib/_emerge/resolver/output.py |
43 |
+++ b/lib/_emerge/resolver/output.py |
44 |
@@ -243,7 +243,6 @@ class Display: |
45 |
cur_use_map[key], old_iuse_map[key], |
46 |
old_use_map[key], is_new, feature_flags, |
47 |
reinst_flags_map.get(key)) |
48 |
- return |
49 |
|
50 |
|
51 |
@staticmethod |
52 |
@@ -539,7 +538,6 @@ class Display: |
53 |
if show_repos and repoadd: |
54 |
myprint += " " + teal("[%s]" % repoadd) |
55 |
writemsg_stdout("%s\n" % (myprint,), noiselevel=-1) |
56 |
- return |
57 |
|
58 |
|
59 |
def print_blockers(self): |
60 |
@@ -548,7 +546,6 @@ class Display: |
61 |
""" |
62 |
for pkg in self.blockers: |
63 |
writemsg_stdout("%s\n" % (pkg,), noiselevel=-1) |
64 |
- return |
65 |
|
66 |
|
67 |
def print_verbose(self, show_repos): |
68 |
@@ -562,7 +559,6 @@ class Display: |
69 |
# that RepoDisplay.__unicode__() is called in python2. |
70 |
writemsg_stdout("%s" % (self.conf.repo_display,), |
71 |
noiselevel=-1) |
72 |
- return |
73 |
|
74 |
|
75 |
def print_changelog(self): |
76 |
@@ -687,7 +683,6 @@ class Display: |
77 |
if ebuild_path_cl is not None: |
78 |
self.changelogs.extend(_calc_changelog( |
79 |
ebuild_path_cl, pkg_info.previous_pkg, pkg.cpv)) |
80 |
- return |
81 |
|
82 |
|
83 |
def check_system_world(self, pkg): |
84 |
|
85 |
diff --git a/lib/portage/elog/mod_custom.py b/lib/portage/elog/mod_custom.py |
86 |
index 7cfafeccc..aaf1d3b1b 100644 |
87 |
--- a/lib/portage/elog/mod_custom.py |
88 |
+++ b/lib/portage/elog/mod_custom.py |
89 |
@@ -18,4 +18,3 @@ def process(mysettings, key, logentries, fulltext): |
90 |
retval = portage.process.spawn_bash(mylogcmd) |
91 |
if retval != 0: |
92 |
raise portage.exception.PortageException("!!! PORTAGE_ELOG_COMMAND failed with exitcode %d" % retval) |
93 |
- return |
94 |
|
95 |
diff --git a/lib/portage/elog/mod_echo.py b/lib/portage/elog/mod_echo.py |
96 |
index 80f2b11ac..dc9edd201 100644 |
97 |
--- a/lib/portage/elog/mod_echo.py |
98 |
+++ b/lib/portage/elog/mod_echo.py |
99 |
@@ -61,4 +61,3 @@ def _finalize(): |
100 |
for line in msgcontent: |
101 |
fmap[msgtype](line.strip("\n")) |
102 |
_items = [] |
103 |
- return |
104 |
|
105 |
diff --git a/lib/portage/elog/mod_mail.py b/lib/portage/elog/mod_mail.py |
106 |
index 38eaa277f..f737a80ce 100644 |
107 |
--- a/lib/portage/elog/mod_mail.py |
108 |
+++ b/lib/portage/elog/mod_mail.py |
109 |
@@ -41,5 +41,3 @@ def process(mysettings, key, logentries, fulltext): |
110 |
portage.mail.send_mail(mysettings, mymessage) |
111 |
except PortageException as e: |
112 |
writemsg("%s\n" % str(e), noiselevel=-1) |
113 |
- |
114 |
- return |
115 |
|
116 |
diff --git a/lib/portage/glsa.py b/lib/portage/glsa.py |
117 |
index 9260e7e09..1870d9338 100644 |
118 |
--- a/lib/portage/glsa.py |
119 |
+++ b/lib/portage/glsa.py |
120 |
@@ -492,7 +492,6 @@ class Glsa: |
121 |
finally: |
122 |
f.close() |
123 |
|
124 |
- return None |
125 |
|
126 |
def parse(self, myfile): |
127 |
""" |
128 |
@@ -583,7 +582,6 @@ class Glsa: |
129 |
self.packages[name].append(tmp) |
130 |
# TODO: services aren't really used yet |
131 |
self.services = self.affected.getElementsByTagName("service") |
132 |
- return None |
133 |
|
134 |
def dump(self, outstream=sys.stdout, encoding="utf-8"): |
135 |
""" |
136 |
@@ -684,7 +682,6 @@ class Glsa: |
137 |
mode='a+', encoding=_encodings['content'], errors='strict') |
138 |
checkfile.write(_unicode_decode(self.nr + "\n")) |
139 |
checkfile.close() |
140 |
- return None |
141 |
|
142 |
def getMergeList(self, least_change=True): |
143 |
""" |
144 |
|
145 |
diff --git a/lib/portage/mail.py b/lib/portage/mail.py |
146 |
index 6503b4cc9..f4fccd8c2 100644 |
147 |
--- a/lib/portage/mail.py |
148 |
+++ b/lib/portage/mail.py |
149 |
@@ -136,4 +136,3 @@ def send_mail(mysettings, message): |
150 |
raise portage.exception.PortageException(_("!!! An error occurred while trying to send logmail:\n")+str(e)) |
151 |
except socket.error as e: |
152 |
raise portage.exception.PortageException(_("!!! A network error occurred while trying to send logmail:\n%s\nSure you configured PORTAGE_ELOG_MAILURI correctly?") % str(e)) |
153 |
- return |
154 |
|
155 |
diff --git a/lib/portage/sync/controller.py b/lib/portage/sync/controller.py |
156 |
index cb68e2c37..0f42b1da9 100644 |
157 |
--- a/lib/portage/sync/controller.py |
158 |
+++ b/lib/portage/sync/controller.py |
159 |
@@ -184,7 +184,6 @@ class SyncManager: |
160 |
writemsg_level(msg + "\n") |
161 |
if self.callback: |
162 |
self.callback(exitcode, updatecache_flg) |
163 |
- return |
164 |
|
165 |
|
166 |
def perform_post_sync_hook(self, reponame, dosyncuri='', repolocation=''): |
167 |
|
168 |
diff --git a/lib/portage/util/whirlpool.py b/lib/portage/util/whirlpool.py |
169 |
index 1071d5155..857abf3ac 100644 |
170 |
--- a/lib/portage/util/whirlpool.py |
171 |
+++ b/lib/portage/util/whirlpool.py |
172 |
@@ -634,7 +634,6 @@ class WhirlpoolStruct: |
173 |
|
174 |
def WhirlpoolInit(ctx): |
175 |
ctx = WhirlpoolStruct() |
176 |
- return |
177 |
|
178 |
def WhirlpoolAdd(source, sourceBits, ctx): |
179 |
if not isinstance(source, bytes): |
180 |
@@ -777,7 +776,6 @@ def processBuffer(ctx): |
181 |
# apply the Miyaguchi-Preneel compression function |
182 |
for i in range(8): |
183 |
ctx.hash[i] ^= state[i] ^ block[i] |
184 |
- return |
185 |
|
186 |
# |
187 |
# Tests. |
188 |
|
189 |
diff --git a/pylintrc b/pylintrc |
190 |
index f2aadf14f..ce5dec11b 100644 |
191 |
--- a/pylintrc |
192 |
+++ b/pylintrc |
193 |
@@ -33,6 +33,7 @@ enable= |
194 |
unused-import, |
195 |
useless-import-alias, |
196 |
useless-object-inheritance, |
197 |
+ useless-return, |
198 |
wildcard-import |
199 |
|
200 |
# A comma-separated list of package or module names from where C extensions may |