Skip to content

Commit 9a5dabd

Browse files
committed
Remove support for positional extra_modules
This is not fully reliable as accidentally passing a non-list as the 2nd param where `extra_modules` was intended will go silently wrong.
1 parent 43262ab commit 9a5dabd

1 file changed

Lines changed: 16 additions & 24 deletions

File tree

easybuild/framework/easyblock.py

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4326,18 +4326,14 @@ def sanity_check_load_module(self, extension=None, extra_modules=None):
43264326
extension - DEPRECATED
43274327
"""
43284328
if extension is not None:
4329-
if extra_modules is None and isinstance(extension, list):
4330-
# 2-parameter form intended as-if `extension` was already removed
4331-
extra_modules = extension
4332-
else:
4333-
self.log.deprecated(
4334-
"Passing `extension` to `sanity_check_load_module` is no longer necessary "
4335-
f"(Easyblock: {self.__class__.__name__}).",
4336-
'6.0',
4337-
)
4338-
if extension != self.is_extension:
4339-
raise EasyBuildError('Unexpected value for `extension` argument. '
4340-
f'Should be: {self.is_extension}, got: {extension}')
4329+
self.log.deprecated(
4330+
"Passing `extension` to `sanity_check_load_module` is no longer necessary "
4331+
f"(Easyblock: {self.__class__.__name__}).",
4332+
'6.0',
4333+
)
4334+
if extension != self.is_extension:
4335+
raise EasyBuildError('Unexpected value for `extension` argument. '
4336+
f'Should be: {self.is_extension}, got: {extension}')
43414337
del extension # Avoid accidental use
43424338

43434339
if self.is_extension:
@@ -4373,18 +4369,14 @@ def _sanity_check_step(self, custom_paths=None, custom_commands=None, extension=
43734369
:param extra_modules: extra modules to load before running sanity check commands
43744370
"""
43754371
if extension is not None:
4376-
if extra_modules is None and isinstance(extension, list):
4377-
# 3-parameter form intended as-if `extension` was already removed
4378-
extra_modules = extension
4379-
else:
4380-
self.log.deprecated(
4381-
"Passing `extension` to `sanity_check_step` is no longer necessary "
4382-
f"(Easyblock: {self.__class__.__name__}).",
4383-
'6.0',
4384-
)
4385-
if extension != self.is_extension:
4386-
raise EasyBuildError('Unexpected value for `extension` argument. '
4387-
f'Should be: {self.is_extension}, got: {extension}')
4372+
self.log.deprecated(
4373+
"Passing `extension` to `sanity_check_step` is no longer necessary "
4374+
f"(Easyblock: {self.__class__.__name__}).",
4375+
'6.0',
4376+
)
4377+
if extension != self.is_extension:
4378+
raise EasyBuildError('Unexpected value for `extension` argument. '
4379+
f'Should be: {self.is_extension}, got: {extension}')
43884380
del extension # Avoid accidental use
43894381

43904382
paths, path_keys_and_check, commands = self._sanity_check_step_common(custom_paths, custom_commands)

0 commit comments

Comments
 (0)