mirror of
https://github.com/lowRISC/ibex.git
synced 2025-04-22 12:57:13 -04:00
Fix isinstance error with Union types
This commit is contained in:
parent
7c8465f9c5
commit
261e9eb3b9
2 changed files with 3 additions and 1 deletions
|
@ -11,6 +11,7 @@ import pickle
|
|||
import pathlib3x as pathlib
|
||||
from io import IOBase
|
||||
from typing import Dict, TextIO, Optional, Union, List
|
||||
from typing_utils import get_args
|
||||
import dataclasses
|
||||
from typeguard import typechecked
|
||||
|
||||
|
@ -232,7 +233,7 @@ def format_dict_to_printable_dict(arg: dict) -> dict:
|
|||
|
||||
def format_to_str(arg: any) -> str:
|
||||
"""Format single arg to str or raise exception if unable."""
|
||||
if isinstance(arg, _YAML_PRINTABLE_TYPES):
|
||||
if isinstance(arg, get_args(_YAML_PRINTABLE_TYPES)):
|
||||
return str(arg)
|
||||
elif isinstance(arg, pathlib.Path):
|
||||
return str(arg.resolve())
|
||||
|
|
|
@ -13,6 +13,7 @@ mako
|
|||
junit-xml
|
||||
# dataclass # needed for backports?
|
||||
pathlib3x # Backports some useful features
|
||||
typing-utils # Ditto
|
||||
gitpython
|
||||
typeguard
|
||||
portalocker
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue