Skip to content

Commit 204bcf1

Browse files
boegelFlamefire
andauthored
apply @Flamefire's suggested code changes
Co-authored-by: Alexander Grund <[email protected]>
1 parent 2d99345 commit 204bcf1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

easybuild/framework/easyconfig/easyconfig.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1810,10 +1810,10 @@ def get_cuda_cc_template_value(self, key):
18101810
Returns user-friendly error message in case neither are defined,
18111811
or if an unknown key is used.
18121812
"""
1813-
if key.startswith('cuda_') and key in [x for (x, _) in TEMPLATE_NAMES_DYNAMIC]:
1814-
if key in self.template_values:
1813+
if key.startswith('cuda_') and any(x[0] == key for x in TEMPLATE_NAMES_DYNAMIC):
1814+
try:
18151815
return self.template_values[key]
1816-
else:
1816+
except KeyError:
18171817
error_msg = "(get_cuda_cc_template_value) Template value '%s' is not defined!\n"
18181818
error_msg += "Make sure that either the --cuda-compute-capabilities EasyBuild configuration "
18191819
error_msg += "option is set, or that the cuda_compute_capabilities easyconfig parameter is defined."

0 commit comments

Comments
 (0)