generated from jCloud/repository-template
chore(utils): mark ExistingDirectory and ExistingFile as deprecated
This commit is contained in:
2 files changed
+14
No files matched your search
@@ -22,6 +22,12 @@ import errno
|
||||
from typing import Union
|
||||
import types
|
||||
|
||||
try:
|
||||
from warnings import deprecated
|
||||
except ImportError:
|
||||
from typing_extensions import deprecated
|
||||
|
||||
@deprecated('Use pathlib.Path instead.')
|
||||
class ExistingDirectory(pathlib.Path):
|
||||
'''
|
||||
pathlib.Path subclass that is a directory.
|
||||
@@ -37,6 +43,7 @@ class ExistingDirectory(pathlib.Path):
|
||||
raise NotADirectoryError(errno.ENOTDIR, 'not a directory', path)
|
||||
super().__init__(*(path, *args), **kwargs)
|
||||
|
||||
@deprecated('Use pathlib.Path instead.')
|
||||
class ExistingFile(pathlib.Path):
|
||||
'''
|
||||
pathlib.Path subclass that is a file.
|
||||
|
||||
Reference in new issue
Block a user