Skip to content

Commit 9e164e3

Browse files
authored
Merge pull request #4834 from Flamefire/super-calls
Remove Python2 constructs
2 parents 4682aa9 + a3f0f81 commit 9e164e3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+241
-234
lines changed

easybuild/base/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,4 @@ def __init__(self, msg, *args, **kwargs):
125125

126126
getattr(logger, self.LOGGING_METHOD_NAME)(msg)
127127

128-
super(LoggedException, self).__init__(msg)
128+
super().__init__(msg)

easybuild/base/frozendict.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ def __init__(self, *args, **kwargs):
8787
msg = "Encountered unknown keys %s (known keys: %s)" % (unknown_keys, self.KNOWN_KEYS)
8888
self.log.raiseException(msg, exception=KeyError)
8989

90-
super(FrozenDictKnownKeys, self).__init__(tmpdict)
90+
super().__init__(tmpdict)
9191

9292
# pylint: disable=arguments-differ
9393
def __getitem__(self, key, *args, **kwargs):
9494
"""Redefine __getitem__ to provide a better KeyError message."""
9595
try:
96-
return super(FrozenDictKnownKeys, self).__getitem__(key, *args, **kwargs)
96+
return super().__getitem__(key, *args, **kwargs)
9797
except KeyError as err:
9898
if key in self.KNOWN_KEYS:
9999
raise KeyError(err)

easybuild/base/generaloption.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ def get_option_by_long_name(self, name):
864864
return None
865865

866866

867-
class GeneralOption(object):
867+
class GeneralOption:
868868
"""
869869
'Used-to-be simple' wrapper class for option parsing
870870
@@ -1745,7 +1745,7 @@ def __init__(self, go_dict=None, short_groupdescr=None, long_groupdescr=None, co
17451745
if config_files is not None:
17461746
kwargs['go_configfiles'] = config_files
17471747

1748-
super(SimpleOption, self).__init__(**kwargs)
1748+
super().__init__(**kwargs)
17491749

17501750
def main_options(self):
17511751
if self.go_dict is not None:

easybuild/base/optcomplete.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class CompleterMissingCallArgument(Exception):
149149
"""Exception to raise when call arg is missing"""
150150

151151

152-
class Completer(object):
152+
class Completer:
153153
"""Base class to derive all other completer classes from.
154154
It generates an empty completion list
155155
"""
@@ -605,7 +605,7 @@ def autocomplete(parser, arg_completer=None, opt_completer=None, subcmd_complete
605605
sys.exit(1)
606606

607607

608-
class CmdComplete(object):
608+
class CmdComplete:
609609

610610
"""Simple default base class implementation for a subcommand that supports
611611
command completion. This class is assuming that there might be a method

easybuild/base/rest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
from easybuild.base import fancylogger
4747

4848

49-
class Client(object):
49+
class Client:
5050
"""An implementation of a REST client"""
5151
DELETE = 'DELETE'
5252
GET = 'GET'
@@ -217,7 +217,7 @@ def get_connection(self, method, url, body, headers):
217217
return connection
218218

219219

220-
class RequestBuilder(object):
220+
class RequestBuilder:
221221
'''RequestBuilder(client).path.to.resource.method(...)
222222
stands for
223223
RequestBuilder(client).client.method('path/to/resource, ...)
@@ -265,7 +265,7 @@ def __repr__(self):
265265
return '%s: %s' % (self.__class__, self.url)
266266

267267

268-
class RestClient(object):
268+
class RestClient:
269269
"""
270270
A client with a request builder, so you can easily create rest requests
271271
e.g. to create a github Rest API client just do

easybuild/base/testing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def assertEqual(self, a, b, msg=None):
8686
"""Make assertEqual always print useful messages"""
8787

8888
try:
89-
super(TestCase, self).assertEqual(a, b, msg=msg)
89+
super().assertEqual(a, b, msg=msg)
9090
except AssertionError as e:
9191
if not self._is_diffable(a) or not self._is_diffable(b):
9292
raise
@@ -132,7 +132,7 @@ def assertAllExist(self, paths, msg=None):
132132

133133
def setUp(self):
134134
"""Prepare test case."""
135-
super(TestCase, self).setUp()
135+
super().setUp()
136136

137137
self.maxDiff = None
138138
self.longMessage = True
@@ -225,4 +225,4 @@ def tearDown(self):
225225
"""Cleanup after running a test."""
226226
self.mock_stdout(False)
227227
self.mock_stderr(False)
228-
super(TestCase, self).tearDown()
228+
super().tearDown()

easybuild/framework/easyblock.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
_log = fancylogger.getLogger('easyblock')
130130

131131

132-
class EasyBlock(object):
132+
class EasyBlock:
133133
"""Generic support for building and installing software, base class for actual easyblocks."""
134134

135135
# static class method for extra easyconfig parameter definitions
@@ -3253,7 +3253,7 @@ def post_install_step(self):
32533253
- run post install commands if any were specified
32543254
"""
32553255
# even though post_install_step is deprecated in easyblocks we need to keep this here until it is
3256-
# removed in 6.0 for easyblocks calling super(EB_xxx, self).post_install_step()
3256+
# removed in 6.0 for easyblocks calling super().post_install_step()
32573257
# The deprecation warning for those is below, in post_processing_step().
32583258

32593259
lib_dir = os.path.join(self.installdir, 'lib')

easybuild/framework/easyconfig/easyconfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ def get_toolchain_hierarchy(parent_toolchain, incl_capabilities=False):
422422
return toolchain_hierarchy
423423

424424

425-
class EasyConfig(object):
425+
class EasyConfig:
426426
"""
427427
Class which handles loading, reading, validation of easyconfigs
428428
"""

easybuild/framework/easyconfig/format/convert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Dependency(Convert):
4141

4242
def __init__(self, obj, name=None):
4343
"""Convert pass object to a dependency, use specified name if provided."""
44-
super(Dependency, self).__init__(obj)
44+
super().__init__(obj)
4545
if name is not None:
4646
self['name'] = name
4747

easybuild/framework/easyconfig/format/format.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def __init__(self, parent=None, depth=None):
130130
NestedDict.__init__(self, self, 0)
131131

132132

133-
class Squashed(object):
133+
class Squashed:
134134
"""Class to ease the squashing of OrderedVersionOperators and OrderedToolchainVersionOperators"""
135135

136136
def __init__(self):
@@ -184,7 +184,7 @@ def final(self):
184184
return self.result
185185

186186

187-
class EBConfigObj(object):
187+
class EBConfigObj:
188188
"""
189189
Enhanced ConfigObj, version/toolchain and other easyconfig specific aspects aware
190190
@@ -600,7 +600,7 @@ def get_specs_for(self, version=None, tcname=None, tcversion=None):
600600
return res
601601

602602

603-
class EasyConfigFormat(object):
603+
class EasyConfigFormat:
604604
"""EasyConfigFormat class"""
605605
VERSION = EasyVersion('0.0') # dummy EasyVersion instance (shouldn't be None)
606606
USABLE = False # disable this class as usable format

0 commit comments

Comments
 (0)