diff --git a/customtkinter/windows/widgets/ctk_progressbar.py b/customtkinter/windows/widgets/ctk_progressbar.py index ce597af..110800c 100644 --- a/customtkinter/windows/widgets/ctk_progressbar.py +++ b/customtkinter/windows/widgets/ctk_progressbar.py @@ -1,6 +1,10 @@ import tkinter import math -from typing import Union, Tuple, Optional, Literal, Callable +from typing import Union, Tuple, Optional, Callable +try: + from typing import Literal +except ImportError: + from typing_extensions import Literal from .core_rendering import CTkCanvas from .theme import ThemeManager diff --git a/customtkinter/windows/widgets/ctk_segmented_button.py b/customtkinter/windows/widgets/ctk_segmented_button.py index af7c19a..73e9df2 100644 --- a/customtkinter/windows/widgets/ctk_segmented_button.py +++ b/customtkinter/windows/widgets/ctk_segmented_button.py @@ -1,5 +1,9 @@ import tkinter -from typing import Union, Tuple, List, Dict, Callable, Optional, Literal +from typing import Union, Tuple, List, Dict, Callable, Optional +try: + from typing import Literal +except ImportError: + from typing_extensions import Literal from .theme import ThemeManager from .font import CTkFont diff --git a/customtkinter/windows/widgets/font/ctk_font.py b/customtkinter/windows/widgets/font/ctk_font.py index 69fb3f7..bdfae07 100644 --- a/customtkinter/windows/widgets/font/ctk_font.py +++ b/customtkinter/windows/widgets/font/ctk_font.py @@ -1,6 +1,10 @@ from tkinter.font import Font import copy -from typing import List, Callable, Tuple, Optional, Literal +from typing import List, Callable, Tuple, Optional +try: + from typing import Literal +except ImportError: + from typing_extensions import Literal from ..theme import ThemeManager