diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2007-08-25 04:32:07 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2007-08-25 04:32:07 (GMT) |
commit | 3af0e785e70164dc6c779d49f6815058e26050be (patch) | |
tree | da45f17cd8969684877795e9861c1d72608dde44 /Doc/library/runpy.rst | |
parent | 68f525fdc8e48425637c4aa712c0ea42e1e26798 (diff) | |
download | cpython-3af0e785e70164dc6c779d49f6815058e26050be.zip cpython-3af0e785e70164dc6c779d49f6815058e26050be.tar.gz cpython-3af0e785e70164dc6c779d49f6815058e26050be.tar.bz2 |
Revert misguided attempt at fixing incompatibility between -m and -i switches (better fix coming soon)
Diffstat (limited to 'Doc/library/runpy.rst')
-rw-r--r-- | Doc/library/runpy.rst | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Doc/library/runpy.rst b/Doc/library/runpy.rst index ce8aa99..cfaab94 100644 --- a/Doc/library/runpy.rst +++ b/Doc/library/runpy.rst @@ -52,11 +52,9 @@ The :mod:`runpy` module provides a single function: If the argument *alter_sys* is supplied and evaluates to ``True``, then ``sys.argv[0]`` is updated with the value of ``__file__`` and - ``sys.modules[__name__]`` is updated with a new module object for the module - being executed. Note that neither ``sys.argv[0]`` nor ``sys.modules[__name__]`` - are restored to their original values before the function returns - if client - code needs these values preserved, it must either save them explicitly or else - avoid enabling the automatic alterations to :mod:`sys`. + ``sys.modules[__name__]`` is updated with a temporary module object for the + module being executed. Both ``sys.argv[0]`` and ``sys.modules[__name__]`` + are restored to their original values before the function returns. Note that this manipulation of :mod:`sys` is not thread-safe. Other threads may see the partially initialised module, as well as the altered list of arguments. |