From 5366a94725e5450e71772c19500d9d2cd4cf659d Mon Sep 17 00:00:00 2001 From: Alexander Date: Tue, 19 Sep 2017 03:10:57 +0300 Subject: [PATCH] clear cache at exit --- PIL/Image.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PIL/Image.py b/PIL/Image.py index a10bb7eae..156925c04 100644 --- a/PIL/Image.py +++ b/PIL/Image.py @@ -110,6 +110,7 @@ import os import sys import io import struct +import atexit # type stuff import collections @@ -2861,3 +2862,4 @@ def _apply_env_variables(env=None): warnings.warn("{0}: {1}".format(var_name, e)) _apply_env_variables() +atexit.register(core.clear_cache)