]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-14678: Update zipimport to support importlib.invalidate_caches() (GH-24159)
authorDesmond Cheong <desmondcheongzx@gmail.com>
Mon, 8 Mar 2021 20:06:02 +0000 (04:06 +0800)
committerGitHub <noreply@github.com>
Mon, 8 Mar 2021 20:06:02 +0000 (12:06 -0800)
commit3abf6f010243a91bf57cbf357dac33193f7b8407
tree10955a6bfecc49ee2bd5ca93efe33c887fd10ded
parentbbba28212ce0f58096a4043f32442c6e727b74fc
bpo-14678: Update zipimport to support importlib.invalidate_caches() (GH-24159)

Added an invalidate_caches() method to the zipimport.zipimporter class based on the implementation of importlib.FileFinder.invalidate_caches(). This was done by adding a get_files() method and an _archive_mtime attribute to zipimport.zipimporter to check for updates or cache invalidation whenever the cache of files and toc entry information in the zipimporter is accessed.
Doc/library/zipimport.rst
Lib/test/test_zipimport.py
Lib/zipimport.py
Misc/NEWS.d/next/Library/2021-01-07-21-25-49.bpo-14678.1zniCH.rst [new file with mode: 0644]
Python/importlib_zipimport.h