Skip to content

Commit

Permalink
fix incompatibility for python <3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
falkoschindler committed Oct 4, 2022
1 parent 856745c commit a53ed76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions nicegui/elements/choice_element.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Callable, Dict, List, Literal, Optional, Union
from typing import Any, Callable, Dict, List, Optional, Union

import justpy as jp

Expand All @@ -21,7 +21,7 @@ def value_to_view(self, value: Any):
except ValueError:
return value

def handle_change(self, msg: Dict) -> Literal[False]:
def handle_change(self, msg: Dict):
index = msg['value']['value'] if isinstance(msg['value'], dict) else msg['value']
msg['index'] = index
msg['label'] = self.labels[index]
Expand Down
4 changes: 2 additions & 2 deletions nicegui/elements/value_element.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Callable, Dict, Literal, Optional
from typing import Any, Callable, Dict, Optional

import justpy as jp

Expand All @@ -25,7 +25,7 @@ def value_to_view(self, value):
def set_value(self, value) -> None:
self.value = value

def handle_change(self, msg: Dict) -> Literal[False]:
def handle_change(self, msg: Dict):
self.value = msg['value']
self.update()
return False
Expand Down

0 comments on commit a53ed76

Please sign in to comment.