Skip to content

Commit

Permalink
fix docs generation issue for Generator type in new term.py changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleysommer committed Jul 30, 2024
1 parent da841ac commit 56ccb7a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rdflib/term.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
Any,
Callable,
Dict,
Generator,
List,
Optional,
Tuple,
Expand Down Expand Up @@ -457,7 +458,7 @@ class BNode(IdentifiedNode):
def __new__(
cls,
value: Optional[str] = None,
_sn_gen: Optional[Union[Callable[[], str], GeneratorType]] = None,
_sn_gen: Optional[Union[Callable[[], str], Generator]] = None,
_prefix: str = _unique_id(),
) -> BNode:
"""
Expand All @@ -468,7 +469,7 @@ def __new__(
# a different instance of this module at some other time.
if _sn_gen is not None:
if callable(_sn_gen):
sn_result: Union[str, GeneratorType] = _sn_gen()
sn_result: Union[str, Generator] = _sn_gen()
else:
sn_result = _sn_gen
if isinstance(sn_result, GeneratorType):
Expand Down

0 comments on commit 56ccb7a

Please sign in to comment.