Skip to content

Commit f3fab15

Browse files
MNT: Apply refurb suggestion
[FURB125]: Return is redundant here
1 parent d33a05a commit f3fab15

File tree

5 files changed

+2
-17
lines changed

5 files changed

+2
-17
lines changed

nibabel/cmdline/dicomfs.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ def __init__(self, fno):
4848
self.fno = fno
4949
self.keep_cache = False
5050
self.direct_io = False
51-
return
5251

5352
def __str__(self):
5453
return 'FileHandle(%d)' % self.fno
@@ -64,7 +63,6 @@ def __init__(self, *args, **kwargs):
6463
self.dicom_path = kwargs.pop('dicom_path', None)
6564
fuse.Fuse.__init__(self, *args, **kwargs)
6665
self.fhs = {}
67-
return
6866

6967
def get_paths(self):
7068
paths = {}
@@ -190,7 +188,6 @@ def release(self, path, flags, fh):
190188
logger.debug(path)
191189
logger.debug(fh)
192190
del self.fhs[fh.fno]
193-
return
194191

195192

196193
def get_opt_parser():

nibabel/dft.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ def __init__(self, series, i, si):
5151
self.series = series
5252
self.i = i
5353
self.si = si
54-
return
5554

5655
def __str__(self):
5756
fmt = 'expecting instance number %d, got %d'
@@ -70,7 +69,6 @@ def __init__(self, d):
7069
self.patient_birth_date = d['patient_birth_date']
7170
self.patient_sex = d['patient_sex']
7271
self.series = None
73-
return
7472

7573
def __getattribute__(self, name):
7674
val = object.__getattribute__(self, name)
@@ -103,7 +101,6 @@ def __init__(self, d):
103101
self.bits_allocated = d['bits_allocated']
104102
self.bits_stored = d['bits_stored']
105103
self.storage_instances = None
106-
return
107104

108105
def __getattribute__(self, name):
109106
val = object.__getattribute__(self, name)
@@ -226,7 +223,6 @@ def __init__(self, d):
226223
self.instance_number = d['instance_number']
227224
self.series = d['series']
228225
self.files = None
229-
return
230226

231227
def __getattribute__(self, name):
232228
val = object.__getattribute__(self, name)
@@ -256,7 +252,6 @@ def __exit__(self, type, value, traceback):
256252
if type is None:
257253
self.c.close()
258254
DB.rollback()
259-
return
260255

261256

262257
class _db_change:
@@ -272,7 +267,6 @@ def __exit__(self, type, value, traceback):
272267
DB.commit()
273268
else:
274269
DB.rollback()
275-
return
276270

277271

278272
def _get_subdirs(base_dir, files_dict=None, followlinks=False):
@@ -316,7 +310,6 @@ def update_cache(base_dir, followlinks=False):
316310
else:
317311
query = "INSERT INTO directory (path, mtime) VALUES (?, ?)"
318312
c.execute(query, (dir, mtimes[dir]))
319-
return
320313

321314

322315
def get_studies(base_dir=None, followlinks=False):
@@ -382,7 +375,6 @@ def _update_dir(c, dir, files, studies, series, storage_instances):
382375
SET mtime = ?, storage_instance = ?
383376
WHERE directory = ? AND name = ?"""
384377
c.execute(query, (mtime, si_uid, dir, fname))
385-
return
386378

387379

388380
def _update_file(c, path, fname, studies, series, storage_instances):
@@ -457,7 +449,6 @@ def clear_cache():
457449
c.execute("DELETE FROM storage_instance")
458450
c.execute("DELETE FROM series")
459451
c.execute("DELETE FROM study")
460-
return
461452

462453

463454
CREATE_QUERIES = (

nibabel/wrapstruct.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ def __init__(self,
172172
self._structarr = wstr.copy()
173173
if check:
174174
self.check_fix()
175-
return
176175

177176
@classmethod
178177
def from_fileobj(klass, fileobj, endianness=None, check=True):

nisext/sexts.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,8 @@ def version_getter(pkg_name):
183183
_add_append_key(setuptools_args['extras_require'],
184184
optional,
185185
dependency)
186-
return
187-
_add_append_key(setuptools_args, 'install_requires', dependency)
188-
return
186+
else:
187+
_add_append_key(setuptools_args, 'install_requires', dependency)
189188

190189

191190
def _package_status(pkg_name, version, version_getter, checker):

nisext/testers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ def contexts_print_info(mod_name, repo_path, install_path):
277277
print(run_mod_cmd(mod_name, site_pkgs_path, cmd_str)[0])
278278
# test from development tree
279279
print(run_mod_cmd(mod_name, repo_path, cmd_str)[0])
280-
return
281280

282281

283282
def info_from_here(mod_name):

0 commit comments

Comments
 (0)