From 9d4c027993dceec8d7fe8a25ea6356a2fa4a3402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Cab=C3=A9?= Date: Mon, 16 Dec 2024 10:50:40 +0100 Subject: [PATCH] twister: reports: use Path instead of PosixPath MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Directly instantiating a PosixPath is not allowed on Windows, use Path instead. Signed-off-by: Benjamin Cabé --- scripts/pylib/twister/twisterlib/reports.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/pylib/twister/twisterlib/reports.py b/scripts/pylib/twister/twisterlib/reports.py index 796815bfd75..cbf605542fb 100644 --- a/scripts/pylib/twister/twisterlib/reports.py +++ b/scripts/pylib/twister/twisterlib/reports.py @@ -11,7 +11,7 @@ import string import xml.etree.ElementTree as ET from datetime import datetime from enum import Enum -from pathlib import PosixPath +from pathlib import Path, PosixPath from colorama import Fore from twisterlib.statuses import TwisterStatus @@ -171,7 +171,7 @@ class Reporting: runnable = suite.get('runnable', 0) duration += float(handler_time) ts_status = TwisterStatus(suite.get('status')) - classname = PosixPath(suite.get("name","")).name + classname = Path(suite.get("name","")).name for tc in suite.get("testcases", []): status = TwisterStatus(tc.get('status')) reason = tc.get('reason', suite.get('reason', 'Unknown')) @@ -253,7 +253,7 @@ class Reporting: ): continue if full_report: - classname = PosixPath(ts.get("name","")).name + classname = Path(ts.get("name","")).name for tc in ts.get("testcases", []): status = TwisterStatus(tc.get('status')) reason = tc.get('reason', ts.get('reason', 'Unknown'))