Skip to content
Snippets Groups Projects
Commit bb4d562c authored by Chris Lamb's avatar Chris Lamb :eyes:
Browse files

Raise NotImplementedError() instances over NotImplemented classes.


Signed-off-by: Chris Lamb's avatarChris Lamb <lamby@debian.org>
parent d2b859b9
No related branches found
No related tags found
No related merge requests found
......@@ -100,7 +100,7 @@ class File(object, metaclass=ABCMeta):
@property
@abstractmethod
def path(self):
raise NotImplemented
raise NotImplementedError()
# Remove any temporary data associated with the file. The function
# should be idempotent and work during the destructor.
......@@ -156,15 +156,15 @@ class File(object, metaclass=ABCMeta):
@abstractmethod
def is_directory():
raise NotImplemented
raise NotImplementedError()
@abstractmethod
def is_symlink():
raise NotImplemented
raise NotImplementedError()
@abstractmethod
def is_device():
raise NotImplemented
raise NotImplementedError()
def compare_bytes(self, other, source=None):
return compare_binary_files(self, other, source)
......
......@@ -61,7 +61,7 @@ class Command(object, metaclass=ABCMeta):
@abstractmethod
def cmdline(self):
raise NotImplemented
raise NotImplementedError()
def env(self):
return None # inherit parent environment by default
......@@ -183,11 +183,11 @@ class Container(object, metaclass=ABCMeta):
@abstractmethod
def get_member_names(self):
raise NotImplemented
raise NotImplementedError()
@abstractmethod
def get_member(self, member_name):
raise NotImplemented
raise NotImplementedError()
def comparisons(self, other):
my_members = self.get_members()
......@@ -276,19 +276,19 @@ class Archive(Container, metaclass=ABCMeta):
@abstractmethod
def open_archive(self):
raise NotImplemented
raise NotImplementedError()
@abstractmethod
def close_archive(self):
raise NotImplemented
raise NotImplementedError()
@abstractmethod
def get_member_names(self):
raise NotImplemented
raise NotImplementedError()
@abstractmethod
def extract(self, member_name, dest_dir):
raise NotImplemented
raise NotImplementedError()
def get_member(self, member_name):
return ArchiveMember(self, member_name)
......@@ -321,7 +321,7 @@ class NonExistingArchive(Archive):
def extract(self, member_name, dest_dir):
# should never be called
raise NotImplemented
raise NotImplementedError()
def get_member(self, member_name):
return NonExistingFile('/dev/null')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment