Skip to content

Commit

Permalink
Merge pull request #43 from canonical/fix-singledispatch
Browse files Browse the repository at this point in the history
fix: work around the singledispatch bug in lower python version
  • Loading branch information
wood-push-melon authored Sep 14, 2023
2 parents e007de4 + f297694 commit 9c0bb87
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bundle_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from io import TextIOWrapper
from pathlib import Path
from textwrap import dedent
from typing import MutableMapping, Union
from typing import MutableMapping

from git import Repo
from jinja2 import Environment, FileSystemLoader
Expand All @@ -24,8 +24,9 @@ def generate_output(output, content: str) -> None:
raise NotImplementedError


@generate_output.register
def _(output: Union[str, Path], content: str) -> None:
@generate_output.register(str)
@generate_output.register(Path)
def _(output, content: str) -> None:
with open(output, mode="wt", encoding="utf-8") as dest:
dest.write(content)

Expand Down

0 comments on commit 9c0bb87

Please sign in to comment.