Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix circular dependency issue #12

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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