Skip to content

Commit

Permalink
Remove obsolete work-around
Browse files Browse the repository at this point in the history
  • Loading branch information
LourensVeen committed Mar 31, 2024
1 parent 93bd891 commit 72e51b5
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 25 deletions.
2 changes: 1 addition & 1 deletion cerulean/factory.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import cast, Optional
from typing import cast, Optional, Type

from cerulean.credential import Credential
from cerulean.direct_gnu_scheduler import DirectGnuScheduler
Expand Down
5 changes: 2 additions & 3 deletions cerulean/file_system.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from abc import ABC
from types import TracebackType
from typing import Any, Optional, Union
from typing import Any, Optional, Type, Union

from cerulean.path import Path
from cerulean.util import BaseExceptionType


class UnsupportedOperationError(RuntimeError):
Expand Down Expand Up @@ -39,7 +38,7 @@ def __enter__(self) -> 'FileSystem':
return self

def __exit__(
self, exc_type: Optional[BaseExceptionType],
self, exc_type: Optional[Type[BaseException]],
exc_value: Optional[BaseException], traceback: Optional[TracebackType]
) -> None:
"""Exit context manager."""
Expand Down
5 changes: 2 additions & 3 deletions cerulean/sftp_file_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
import stat
from pathlib import PurePosixPath
from types import TracebackType
from typing import Any, cast, Generator, Iterable, Optional
from typing import Any, cast, Generator, Iterable, Optional, Type

import paramiko
from cerulean.file_system import FileSystem
from cerulean.file_system_impl import FileSystemImpl
from cerulean.path import AbstractPath, EntryType, Path, Permission
from cerulean.ssh_terminal import SshTerminal
from cerulean.util import BaseExceptionType


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -57,7 +56,7 @@ def __enter__(self) -> 'SftpFileSystem':
return self

def __exit__(
self, exc_type: Optional[BaseExceptionType],
self, exc_type: Optional[Type[BaseException]],
exc_value: Optional[BaseException], traceback: Optional[TracebackType]
) -> None:
"""Exit context manager."""
Expand Down
5 changes: 2 additions & 3 deletions cerulean/ssh_terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
import socket
from time import perf_counter
from types import TracebackType
from typing import Any, List, Optional, Tuple, Type, TYPE_CHECKING
from typing import Any, List, Optional, Tuple, Type

import paramiko
from cerulean.credential import (Credential, PasswordCredential,
PubKeyCredential)
from cerulean.terminal import Terminal
from cerulean.util import BaseExceptionType


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -39,7 +38,7 @@ def __enter__(self) -> 'SshTerminal':
return self

def __exit__(
self, exc_type: Optional[BaseExceptionType],
self, exc_type: Optional[Type[BaseException]],
exc_value: Optional[BaseException],
traceback: Optional[TracebackType]) -> None:
"""Exit context manager."""
Expand Down
6 changes: 2 additions & 4 deletions cerulean/terminal.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from abc import ABC, abstractmethod
from types import TracebackType
from typing import Any, List, Optional, Tuple

from cerulean.util import BaseExceptionType
from typing import Any, List, Optional, Tuple, Type


class Terminal(ABC):
Expand All @@ -23,7 +21,7 @@ def __enter__(self) -> 'Terminal':
return self

def __exit__(
self, exc_type: Optional[BaseExceptionType],
self, exc_type: Optional[Type[BaseException]],
exc_value: Optional[BaseException],
traceback: Optional[TracebackType]) -> None:
"""Exit context manager."""
Expand Down
8 changes: 0 additions & 8 deletions cerulean/util.py

This file was deleted.

5 changes: 2 additions & 3 deletions cerulean/webdav_file_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import requests
from urllib.parse import urljoin
from types import TracebackType
from typing import Any, cast, Dict, Generator, Iterable, Optional
from typing import Any, cast, Dict, Generator, Iterable, Optional, Type
from xml.etree.ElementTree import Element

import defusedxml.ElementTree as ET # type: ignore
Expand All @@ -13,7 +13,6 @@
from cerulean.file_system import FileSystem, UnsupportedOperationError
from cerulean.file_system_impl import FileSystemImpl
from cerulean.path import AbstractPath, EntryType, Path, Permission
from cerulean.util import BaseExceptionType


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -74,7 +73,7 @@ def __enter__(self) -> 'WebdavFileSystem':
return self

def __exit__(
self, exc_type: Optional[BaseExceptionType],
self, exc_type: Optional[Type[BaseException]],
exc_value: Optional[BaseException],
traceback: Optional[TracebackType]) -> None:
"""Exit context manager."""
Expand Down

0 comments on commit 72e51b5

Please sign in to comment.