Skip to content

Commit

Permalink
Removed NoneType, because it's not supported by Python 3.9.
Browse files Browse the repository at this point in the history
  • Loading branch information
Paebbels committed Jun 3, 2024
1 parent 17ff2ea commit 62bcb1b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions pyEDAA/Reports/OSVVM/AlertLog.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
from enum import Enum, auto
from pathlib import Path
from time import perf_counter_ns
from types import NoneType
from typing import Optional as Nullable, Dict, Iterator, Iterable

from ruamel.yaml import YAML, CommentedSeq, CommentedMap
Expand Down Expand Up @@ -271,7 +270,7 @@ def _ParseSequenceFromYAML(node: CommentedMap, fieldName: str) -> Nullable[Comme
newEx.add_note(f"Available fields: {', '.join(key for key in node)}")
raise newEx from ex

if isinstance(value, NoneType):
if value is None:
return ()
elif not isinstance(value, CommentedSeq):
ex = AlertLogException(f"Field '{fieldName}' is not a sequence.") # TODO: from TypeError??
Expand All @@ -289,7 +288,7 @@ def _ParseMapFromYAML(node: CommentedMap, fieldName: str) -> Nullable[CommentedM
newEx.add_note(f"Available fields: {', '.join(key for key in node)}")
raise newEx from ex

if isinstance(value, NoneType):
if value is None:
return {}
elif not isinstance(value, CommentedMap):
ex = AlertLogException(f"Field '{fieldName}' is not a list.") # TODO: from TypeError??
Expand Down
5 changes: 2 additions & 3 deletions pyEDAA/Reports/Unittesting/OSVVM.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
from datetime import timedelta, datetime
from pathlib import Path
from time import perf_counter_ns
from types import NoneType
from typing import Optional as Nullable

from ruamel.yaml import YAML, CommentedMap, CommentedSeq
Expand Down Expand Up @@ -126,7 +125,7 @@ def _ParseSequenceFromYAML(node: CommentedMap, fieldName: str) -> Nullable[Comme
newEx.add_note(f"Available fields: {', '.join(key for key in node)}")
raise newEx from ex

if isinstance(value, NoneType):
if value is None:
return ()
elif not isinstance(value, CommentedSeq):
line = node._yaml_line_col.data[fieldName][0] + 1
Expand All @@ -145,7 +144,7 @@ def _ParseMapFromYAML(node: CommentedMap, fieldName: str) -> Nullable[CommentedM
newEx.add_note(f"Available fields: {', '.join(key for key in node)}")
raise newEx from ex

if isinstance(value, NoneType):
if value is None:
return {}
elif not isinstance(value, CommentedMap):
line = node._yaml_line_col.data[fieldName][0] + 1
Expand Down

0 comments on commit 62bcb1b

Please sign in to comment.