Skip to content

Commit

Permalink
fix(opendataset): fix the AttributeError calling mocker class methods
Browse files Browse the repository at this point in the history
PR Closed: #1119
  • Loading branch information
Lee-000 committed Nov 22, 2021
1 parent 5771933 commit 2dab64b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tensorbay/opendataset/_utility/mocker.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@
from tensorbay.exception import ModuleImportError


class Image:
class ImageMocker:
"""Raise import PIL error for data loader."""

def __getattribute__(self, name: str) -> None:
raise ModuleImportError(module_name="pillow")


class xmltodict:
class xmltodictMocker:
"""Raise import xmltodict error for data loader."""

def __getattribute__(self, name: str) -> None:
raise ModuleImportError(module_name="xmltodict")


Image = ImageMocker()
xmltodict = xmltodictMocker()

0 comments on commit 2dab64b

Please sign in to comment.