Skip to content

Commit c10f1e0

Browse files
authored
Merge pull request #4049 from Flamefire/linter
Fix linting issues
2 parents f0686d1 + 7d63e0c commit c10f1e0

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

easybuild/base/fancylogger.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,9 +380,9 @@ def streamLog(self, levelno, data):
380380

381381
def write_and_flush_stream(hdlr, data=None):
382382
"""Write to stream and flush the handler"""
383-
if (not hasattr(hdlr, 'stream')) or hdlr.stream is None:
383+
if getattr(hdlr, 'stream', None) is None:
384384
# no stream or not initialised.
385-
raise("write_and_flush_stream failed. No active stream attribute.")
385+
raise ValueError("write_and_flush_stream failed. No active stream attribute.")
386386
if data is not None:
387387
hdlr.stream.write(data)
388388
hdlr.flush()

easybuild/framework/easyblock.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,7 @@ def gen_builddir(self):
973973
if not self.cfg.get('cleanupoldbuild', False):
974974
uniq_builddir = builddir
975975
suff = 0
976-
while(os.path.isdir(uniq_builddir)):
976+
while os.path.isdir(uniq_builddir):
977977
uniq_builddir = "%s.%d" % (builddir, suff)
978978
suff += 1
979979
builddir = uniq_builddir

easybuild/framework/easyconfig/format/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def __bool__(self):
117117

118118
def is_valid(self):
119119
"""Check if this is a valid VersionOperator. Suffix can be anything."""
120-
return not(self.version is None or self.operator is None)
120+
return not (self.version is None or self.operator is None)
121121

122122
def set(self, versop_str):
123123
"""

easybuild/tools/filetools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2870,7 +2870,7 @@ def copy_framework_files(paths, target_dir):
28702870
if framework_topdir in dirnames:
28712871
# construct subdirectory by grabbing last entry in dirnames until we hit 'easybuild-framework' dir
28722872
subdirs = []
2873-
while(dirnames[-1] != framework_topdir):
2873+
while dirnames[-1] != framework_topdir:
28742874
subdirs.insert(0, dirnames.pop())
28752875

28762876
parent_dir = os.path.join(*subdirs) if subdirs else ''

easybuild/tools/modules.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ def check_module_path(self):
462462
else:
463463
# filter out tail of paths that already matches tail of target, to avoid unnecessary 'unuse' commands
464464
idx = 1
465-
while(curr_mod_paths[-idx:] == self.mod_paths[-idx:]):
465+
while curr_mod_paths[-idx:] == self.mod_paths[-idx:]:
466466
idx += 1
467467
self.log.debug("Not prepending %d last entries of %s", idx - 1, self.mod_paths)
468468

0 commit comments

Comments
 (0)