Skip to content

fix: update icon type check to use get_args for python 3.9 compatibility #5252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sdk/python/packages/flet/src/flet/core/tabs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, List, Optional, Union
from typing import Any, List, Optional, Union, get_args

from flet.core.adaptive_control import AdaptiveControl
from flet.core.animation import AnimationValue
Expand Down Expand Up @@ -73,7 +73,7 @@ def _get_children(self):
def before_update(self):
super().before_update()
self._set_attr_json("iconMargin", self.__icon_margin)
if isinstance(self.__icon, IconValue):
if isinstance(self.__icon, get_args(IconValue)):
self._set_enum_attr("icon", self.__icon, IconEnums)

# text
Expand Down