Skip to content

Commit

Permalink
πŸ§‘β€πŸ’» Add type to the TypeError in loop_over.
Browse files Browse the repository at this point in the history
  • Loading branch information
rafalkrupinski committed Feb 23, 2024
1 parent 3243c5c commit a9aa89d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
14 changes: 12 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
# Changelog

# 0.2.1 - 2023-12-27
# [Unreleased]

### Added

- Add parameter type to the TypeError when it's not an Iterable

### Fixed

- Create parent directories

# 0.2.1 - 2024-02-09

### Fixed

- Fix configuring JinjaAdapter when an instance of Environment is passed.

## 0.2.0 - 2023-12-27
## 0.2.0 - 2024-02-09

### Changed

Expand Down
3 changes: 1 addition & 2 deletions src/rybak/tree_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def loop_over(items: Iterable) -> NoReturn:
if isinstance(items, str):
raise TypeError('Expected an Iterable other than str')
if not isinstance(items, Iterable):
raise TypeError('Expected an Iterable')
raise TypeError('Expected an Iterable', type(items))
raise StartIteration(items)


Expand Down Expand Up @@ -94,7 +94,6 @@ def _render_dir(self, template_name: str, target_name: str, data: TemplateData):

if target_path.exists() and not target_path.is_dir():
target_path.unlink()
target_path.mkdir(exist_ok=True)

self._with_subdir(template_name, target_name).render(data)

Expand Down

0 comments on commit a9aa89d

Please sign in to comment.