diff --git a/src/nanoemoji/parts.py b/src/nanoemoji/parts.py index 3ae3a162..a800e217 100644 --- a/src/nanoemoji/parts.py +++ b/src/nanoemoji/parts.py @@ -23,7 +23,7 @@ from typing import Iterable, List, MutableMapping, NewType, Set, Tuple, Union -PathSource = Union[SVGShape, Iterable[SVGShape], "ReuseableParts", Path] +PathSource = Union[SVGShape, Iterable[SVGShape], "ReuseableParts"] @lru_cache(maxsize=1) @@ -76,9 +76,6 @@ def _add(self, shape: Shape): self._add_norm_path(norm, shape) def add(self, source: PathSource): - if isinstance(source, Path): - source = ReuseableParts.load(source) - if isinstance(source, ReuseableParts): for normalized, shape_set in source.shape_sets.items(): for shape in shape_set: diff --git a/tests/parts_test.py b/tests/parts_test.py index 324ff45b..fa379390 100644 --- a/tests/parts_test.py +++ b/tests/parts_test.py @@ -78,7 +78,7 @@ def test_merge(): def test_file_io(): parts = ReuseableParts() - parts.add(locate_test_file("rect.svg")) + parts.add(ReuseableParts.load(locate_test_file("rect.svg"))) check_num_shapes(parts, 1) tmp_dir = mkdtemp()