Skip to content

gh-133829: Update zipimport example to not mention Python 2.3 #133835

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
21 changes: 11 additions & 10 deletions Doc/library/zipimport.rst
Original file line number Diff line number Diff line change
Expand Up @@ -187,18 +187,19 @@ Here is an example that imports a module from a ZIP archive - note that the
:mod:`zipimport` module is not explicitly used.

.. code-block:: shell-session

$ unzip -l example.zip
Archive: example.zip
$ unzip -l example_archive.zip
Archive: example_archive.zip
Length Date Time Name
-------- ---- ---- ----
8467 11-26-02 22:30 jwzthreading.py
8467 05-11-25 12:29 example.py
-------- -------
8467 1 file
$ ./python
Python 2.3 (#1, Aug 1 2003, 19:54:32)

.. code-block:: python

>>> import sys
>>> sys.path.insert(0, 'example.zip') # Add .zip file to front of path
>>> import jwzthreading
>>> jwzthreading.__file__
'example.zip/jwzthreading.py'
>>> sys.path.insert(0, 'example_archive.zip') # Add .zip file to front of path
>>> import example
>>> example.__file__
'example_archive.zip/example.py'

Loading