Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

Commit 005d7fb

Browse files
lazkaashwoods
authored andcommitted
stacks: Fix "filename" not being relative for traces generated on Windows
Instead of hardcoding "/" use os.sep
1 parent e52c837 commit 005d7fb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

raven/utils/stacks.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import inspect
1111
import linecache
1212
import re
13+
import os
1314
import sys
1415

1516
from raven.utils.serializer import transform
@@ -278,7 +279,7 @@ def get_stack_info(frames, transformer=transform, capture_locals=True,
278279
try:
279280
base_filename = sys.modules[module_name.split('.', 1)[0]].__file__
280281
filename = abs_path.split(
281-
base_filename.rsplit('/', 2)[0], 1)[-1].lstrip("/")
282+
base_filename.rsplit(os.sep, 2)[0], 1)[-1].lstrip(os.sep)
282283
except Exception:
283284
filename = abs_path
284285

0 commit comments

Comments
 (0)