twister: Initialise Colorama during module load
This commit adds a call to the Colorama initialisation function during the module execution so that ANSI color sequences are properly converted to the relevant Win32 API calls on the Windows. Note that the init function needs to be called per module, hence it is also called in the `twisterlib.py`. Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit is contained in:
parent
70c978bb97
commit
aae454708d
2 changed files with 6 additions and 0 deletions
|
@ -28,6 +28,7 @@ import xml.etree.ElementTree as ET
|
|||
import logging
|
||||
from pathlib import Path
|
||||
from distutils.spawn import find_executable
|
||||
import colorama
|
||||
from colorama import Fore
|
||||
import pickle
|
||||
import platform
|
||||
|
@ -4714,3 +4715,5 @@ class HardwareMap:
|
|||
table.append([platform, p.id, p.serial])
|
||||
|
||||
print(tabulate(table, headers=header, tablefmt="github"))
|
||||
|
||||
colorama.init()
|
||||
|
|
|
@ -173,6 +173,7 @@ import shutil
|
|||
from collections import OrderedDict
|
||||
import multiprocessing
|
||||
from itertools import islice
|
||||
import colorama
|
||||
from colorama import Fore
|
||||
from pathlib import Path
|
||||
from multiprocessing.managers import BaseManager
|
||||
|
@ -832,6 +833,8 @@ def setup_logging(outdir, log_file, verbose, timestamps):
|
|||
def main():
|
||||
start_time = time.time()
|
||||
|
||||
colorama.init()
|
||||
|
||||
options = parse_arguments()
|
||||
|
||||
previous_results = None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue