summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorDesmond Cheong <desmondcheongzx@gmail.com>2021-03-08 20:06:02 (GMT)
committerGitHub <noreply@github.com>2021-03-08 20:06:02 (GMT)
commit3abf6f010243a91bf57cbf357dac33193f7b8407 (patch)
tree10955a6bfecc49ee2bd5ca93efe33c887fd10ded /Doc/library
parentbbba28212ce0f58096a4043f32442c6e727b74fc (diff)
downloadcpython-3abf6f010243a91bf57cbf357dac33193f7b8407.zip
cpython-3abf6f010243a91bf57cbf357dac33193f7b8407.tar.gz
cpython-3abf6f010243a91bf57cbf357dac33193f7b8407.tar.bz2
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.
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/zipimport.rst9
1 files changed, 9 insertions, 0 deletions
diff --git a/Doc/library/zipimport.rst b/Doc/library/zipimport.rst
index 62e1e47..cd7030f 100644
--- a/Doc/library/zipimport.rst
+++ b/Doc/library/zipimport.rst
@@ -166,6 +166,15 @@ zipimporter Objects
Use :meth:`exec_module` instead.
+
+ .. method:: invalidate_caches()
+
+ Clear out the internal cache of information about files found within
+ the ZIP archive.
+
+ .. versionadded:: 3.10
+
+
.. attribute:: archive
The file name of the importer's associated ZIP file, without a possible