Skip to content

Commit

Permalink
test if macos failure happens without the init changes
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewkho committed Apr 24, 2024
1 parent 99a4260 commit 358f475
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions torchdata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

import importlib
# import importlib

from torchdata import _extension # noqa: F401

from . import datapipes

janitor = datapipes.utils.janitor

try:
from .version import __version__ # noqa: F401
Expand All @@ -20,15 +26,15 @@
assert __all__ == sorted(__all__)


# Lazy import all modules
def __getattr__(name):
if name == "janitor":
return importlib.import_module(".datapipes.utils." + name, __name__)
else:
try:
return importlib.import_module("." + name, __name__)
except ModuleNotFoundError:
if name in globals():
return globals()[name]
else:
raise AttributeError(f"module {__name__!r} has no attribute {name!r}") from None
# # Lazy import all modules
# def __getattr__(name):
# if name == "janitor":
# return importlib.import_module(".datapipes.utils." + name, __name__)
# else:
# try:
# return importlib.import_module("." + name, __name__)
# except ModuleNotFoundError:
# if name in globals():
# return globals()[name]
# else:
# raise AttributeError(f"module {__name__!r} has no attribute {name!r}") from None

0 comments on commit 358f475

Please sign in to comment.