Call this before closing tk root

def clear_cache(cls):
        """Call this before closing tk root"""
        #Prevent tkinter errors on python 2 ??
        for key in cls._cached:
            cls._cached[key] = None
        cls._cached = {}