diff --git a/customtkinter/widgets/widget_base_class.py b/customtkinter/widgets/widget_base_class.py index 0f378e9..dd2aa23 100644 --- a/customtkinter/widgets/widget_base_class.py +++ b/customtkinter/widgets/widget_base_class.py @@ -2,7 +2,12 @@ import tkinter import tkinter.ttk as ttk import copy import re -from typing import Callable, Union, TypedDict +from typing import Callable, Union + +try: + from typing import TypedDict +except ImportError: + from typing_extensions import TypedDict from ..windows.ctk_tk import CTk from ..windows.ctk_toplevel import CTkToplevel diff --git a/setup.cfg b/setup.cfg index f192ec7..f7165ef 100644 --- a/setup.cfg +++ b/setup.cfg @@ -20,4 +20,5 @@ packages = customtkinter.windows install_requires = darkdetect + typing_extensions; python_version<="3.7" include_package_data = True