Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(46306)

Delta Between Two Patch Sets: Doc/library/runpy.rst

Issue 14285: Traceback wrong on ImportError while executing a package
Left Patch Set: Created 3 years, 9 months ago
Right Patch Set: Created 3 years, 9 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | Doc/using/cmdline.rst » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 :mod:`runpy` --- Locating and executing Python modules 1 :mod:`runpy` --- Locating and executing Python modules
2 ====================================================== 2 ======================================================
3 3
4 .. module:: runpy 4 .. module:: runpy
5 :synopsis: Locate and run Python modules without importing them first. 5 :synopsis: Locate and run Python modules without importing them first.
6 .. moduleauthor:: Nick Coghlan <ncoghlan@gmail.com> 6 .. moduleauthor:: Nick Coghlan <ncoghlan@gmail.com>
7 7
8 **Source code:** :source:`Lib/runpy.py` 8 **Source code:** :source:`Lib/runpy.py`
9 9
10 -------------- 10 --------------
(...skipping 18 matching lines...) Expand all
29 .. function:: run_module(mod_name, init_globals=None, run_name=None, alter_sys=F alse) 29 .. function:: run_module(mod_name, init_globals=None, run_name=None, alter_sys=F alse)
30 30
31 .. index:: 31 .. index::
32 module: __main__ 32 module: __main__
33 33
34 Execute the code of the specified module and return the resulting module 34 Execute the code of the specified module and return the resulting module
35 globals dictionary. The module's code is first located using the standard 35 globals dictionary. The module's code is first located using the standard
36 import mechanism (refer to :pep:`302` for details) and then executed in a 36 import mechanism (refer to :pep:`302` for details) and then executed in a
37 fresh module namespace. 37 fresh module namespace.
38 38
39 If the supplied module name refers to a package rather than a normal 39 The *mod_name* argument should be an absolute module name.
40 If the module name refers to a package rather than a normal
40 module, then that package is imported and the ``__main__`` submodule within 41 module, then that package is imported and the ``__main__`` submodule within
41 that package is then executed and the resulting module globals dictionary 42 that package is then executed and the resulting module globals dictionary
42 returned. 43 returned.
43 44
44 The optional dictionary argument *init_globals* may be used to pre-populate 45 The optional dictionary argument *init_globals* may be used to pre-populate
45 the module's globals dictionary before the code is executed. The supplied 46 the module's globals dictionary before the code is executed. The supplied
46 dictionary will not be modified. If any of the special global variables 47 dictionary will not be modified. If any of the special global variables
47 below are defined in the supplied dictionary, those definitions are 48 below are defined in the supplied dictionary, those definitions are
48 overridden by :func:`run_module`. 49 overridden by :func:`run_module`.
49 50
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 169
169 :pep:`366` -- Main module explicit relative imports 170 :pep:`366` -- Main module explicit relative imports
170 PEP written and implemented by Nick Coghlan. 171 PEP written and implemented by Nick Coghlan.
171 172
172 :pep:`451` -- A ModuleSpec Type for the Import System 173 :pep:`451` -- A ModuleSpec Type for the Import System
173 PEP written and implemented by Eric Snow 174 PEP written and implemented by Eric Snow
174 175
175 :ref:`using-on-general` - CPython command line details 176 :ref:`using-on-general` - CPython command line details
176 177
177 The :func:`importlib.import_module` function 178 The :func:`importlib.import_module` function
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+