Skip to content

Commit

Permalink
Use DeprecationWarning
Browse files Browse the repository at this point in the history
  • Loading branch information
brentyi committed Jun 1, 2024
1 parent 7dac455 commit db4ae8d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/viser/_gui_handles.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ class GuiContainerProtocol(Protocol):


class SupportsRemoveProtocol(Protocol):
def remove(self) -> None:
...
def remove(self) -> None: ...


@dataclasses.dataclass
Expand Down
2 changes: 2 additions & 0 deletions src/viser/_viser.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def __getattr__(self, name: str) -> Any:
if hasattr(self.scene, fixed_name):
warnings.warn(
f"{type(self).__name__}.{name} has been deprecated, use {type(self).__name__}.scene.{fixed_name} instead. Alternatively, pin to `viser<0.2.0`.",
category=DeprecationWarning,
stacklevel=2,
)
return object.__getattribute__(self.scene, fixed_name)
Expand All @@ -50,6 +51,7 @@ def __getattr__(self, name: str) -> Any:
if hasattr(self.gui, fixed_name):
warnings.warn(
f"{type(self).__name__}.{name} has been deprecated, use {type(self).__name__}.gui.{fixed_name} instead. Alternatively, pin to `viser<0.2.0`.",
category=DeprecationWarning,
stacklevel=2,
)
return object.__getattribute__(self.gui, fixed_name)
Expand Down

0 comments on commit db4ae8d

Please sign in to comment.