diff --git a/reframe/core/exceptions.py b/reframe/core/exceptions.py index 6f63402ef3..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) + source = ''.join(frame.code_context or '') reason += f': {relpath}:{frame.lineno}: {exc_value}\n{source}' else: if str(exc_value):