[6.0.x] Refs #36680 -- Fixed admin_scripts tests crash when black is not installed.

Regression in 6436ec3210.
Backport of 3939cd2795 from main.
This commit is contained in:
Mariusz Felisiak 2025-10-30 12:38:17 +01:00 committed by Natalia
parent e217139f53
commit 11cfb573d2

View file

@ -119,7 +119,8 @@ class AdminScriptTestCase(SimpleTestCase):
path_component
for path_component in os.environ.get("PATH", "").split(os.pathsep)
for formatter_path in find_formatters().values()
if os.path.commonpath([path_component, formatter_path]) == os.sep
if formatter_path
and os.path.commonpath([path_component, formatter_path]) == os.sep
]
)