Skip to content

Commit 6bd1ec9

Browse files
author
Vasileios Karakasis
committed
Use relative paths for filenames in deprecation warnings
1 parent 78b9345 commit 6bd1ec9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

reframe/core/warnings.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import contextlib
22
import inspect
3+
import os
34
import warnings
45

56
from reframe.core.exceptions import ReframeFatalError
@@ -30,6 +31,8 @@ def _format_warning(message, category, filename, lineno, line=None):
3031
except IndexError:
3132
line = '<no line information>'
3233

34+
# Use a relative path
35+
filename = os.path.relpath(filename)
3336
message = f'{filename}:{lineno}: WARNING: {message}\n{line}\n'
3437

3538
# Ignore coloring if runtime has not been initialized; this can happen

0 commit comments

Comments
 (0)