Skip to content

Commit

Permalink
Fix circular dependency issue
Browse files Browse the repository at this point in the history
  • Loading branch information
shssoichiro committed Oct 23, 2024
1 parent 88e1d02 commit 138cc22
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stgpytools/types/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
from pathlib import Path
from typing import TYPE_CHECKING, Any, Callable, Iterable, Literal, TypeAlias, Union

from ..exceptions import FileNotExistsError, PathIsNotADirectoryError

__all__ = [
'FilePathType', 'FileDescriptor',
'FileOpener',
Expand Down Expand Up @@ -146,6 +144,7 @@ def copy_dir(self, dst: SPath) -> SPath:
"""Copy the directory to the specified destination."""

if not self.is_dir():
from ..exceptions import PathIsNotADirectoryError
raise PathIsNotADirectoryError('The given path, \"{self}\" is not a directory!', self.copy_dir)

dst.mkdirp()
Expand Down Expand Up @@ -182,6 +181,7 @@ def get_size(self) -> int:
"""Get the size of the file or directory in bytes."""

if not self.exists():
from ..exceptions import FileNotExistsError
raise FileNotExistsError('The given path, \"{self}\" is not a file or directory!', self.get_size)

if self.is_file():
Expand Down

0 comments on commit 138cc22

Please sign in to comment.