From 54995543ee8ae42c5e1dada125aaebffa571d4c9 Mon Sep 17 00:00:00 2001 From: ShinYee Date: Sat, 26 Mar 2022 20:01:38 +0800 Subject: [PATCH 1/2] Fix TypeError in user error description. --- reframe/core/exceptions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reframe/core/exceptions.py b/reframe/core/exceptions.py index 6f63402ef3..d7418da4a2 100644 --- a/reframe/core/exceptions.py +++ b/reframe/core/exceptions.py @@ -366,7 +366,7 @@ def what(exc_type, exc_value, tb): elif is_user_error(exc_type, exc_value, tb): frame = user_frame(exc_type, exc_value, tb) relpath = os.path.relpath(frame.filename) - source = ''.join(frame.code_context) + source = ''.join(frame.code_context or '') reason += f': {relpath}:{frame.lineno}: {exc_value}\n{source}' else: if str(exc_value): From 4fc10414aad3b76d4595b6d714581bff2668415a Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Tue, 29 Mar 2022 16:38:46 +0200 Subject: [PATCH 2/2] Address PR comments --- reframe/core/exceptions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reframe/core/exceptions.py b/reframe/core/exceptions.py index d7418da4a2..5223bf6490 100644 --- a/reframe/core/exceptions.py +++ b/reframe/core/exceptions.py @@ -366,7 +366,7 @@ def what(exc_type, exc_value, tb): elif is_user_error(exc_type, exc_value, tb): frame = user_frame(exc_type, exc_value, tb) relpath = os.path.relpath(frame.filename) - source = ''.join(frame.code_context or '') + source = ''.join(frame.code_context or '') reason += f': {relpath}:{frame.lineno}: {exc_value}\n{source}' else: if str(exc_value):