Skip to content

Commit

Permalink
Fix types to be compatible with Python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
r0x0r committed Mar 4, 2024
1 parent 10d5dcd commit 38d69f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions webview/dom/dom.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional, Union
from typing import List, Optional, Union
from webview.dom import ManipulationMode
from webview.dom.element import Element
from webview.util import escape_quotes
Expand Down Expand Up @@ -55,7 +55,7 @@ def get_element(self, selector: str) -> Optional[Element]:

return Element(self.__window, node_id) if node_id else None

def get_elements(self, selector: str) -> list[Element]:
def get_elements(self, selector: str) -> List[Element]:
self.__window.events.loaded.wait()
code = f"""
var elements = document.querySelectorAll('{selector}');
Expand Down
4 changes: 2 additions & 2 deletions webview/dom/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from collections import defaultdict
from functools import wraps
from typing import Any, Callable, Dict, Iterable, Optional, Union
from typing import Any, Callable, Dict, Iterable, List, Optional, Union

from webview.dom import DOMEventHandler, ManipulationMode
from webview.dom.classlist import ClassList
Expand Down Expand Up @@ -194,7 +194,7 @@ def focus(self) -> None:
@property
@_exists
@_ignore_window_document
def children(self) -> list['Element']:
def children(self) -> List['Element']:
children = self._window.evaluate_js(f"""
{self._query_command};
var children = element.children;
Expand Down

0 comments on commit 38d69f2

Please sign in to comment.