We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fb16de1 commit 6e9ce48Copy full SHA for 6e9ce48
debug_toolbar/panels/profiling.py
@@ -42,10 +42,14 @@ def is_project_func(self):
42
"""
43
if hasattr(settings, "BASE_DIR"):
44
file_name, _, _ = self.func
45
- return (
46
- str(settings.BASE_DIR) in file_name
47
- and "/site-packages/" not in file_name
48
- and "/dist-packages/" not in file_name
+ base_dir = str(settings.BASE_DIR)
+
+ file_name = os.path.normpath(file_name)
+ base_dir = os.path.normpath(base_dir)
49
50
+ return file_name.startswith(base_dir) and not any(
51
+ directory in file_name.split(os.path.sep)
52
+ for directory in ["site-packages", "dist-packages"]
53
)
54
return None
55
0 commit comments