Skip to content

Commit

Permalink
Fix annotation for parent
Browse files Browse the repository at this point in the history
  • Loading branch information
insolor committed May 26, 2023
1 parent 040f847 commit 244aba8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tkinter_layout_helpers/parent_manager.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import contextlib
import tkinter as tk
from typing import ContextManager
from typing import ContextManager, Union


class DefaultRootWrapper: # pragma: no cover
Expand All @@ -17,7 +17,7 @@ def default_root(self, value: tk.Widget):


@contextlib.contextmanager
def set_parent(parent: tk.Widget) -> ContextManager[tk.Widget]:
def set_parent(parent: Union[tk.Tk, tk.Toplevel, tk.Widget]) -> ContextManager[tk.Widget]:
old_root = _default_root_wrapper.default_root
_default_root_wrapper.default_root = parent
try:
Expand Down

0 comments on commit 244aba8

Please sign in to comment.