aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2012-07-30 17:45:54 -0400
committerBrett Cannon <brett@python.org>2012-07-30 17:45:54 -0400
commit722d3aec2eef7228c03ee12c53c75bb090c069e0 (patch)
treed560b6a044964068780571617f30628aca3df6e1 /Python/bltinmodule.c
parentIssue #12288: Consider '0' and '0.0' as valid initialvalue for tkinter Simple... (diff)
downloadcpython-722d3aec2eef7228c03ee12c53c75bb090c069e0.tar.gz
cpython-722d3aec2eef7228c03ee12c53c75bb090c069e0.tar.bz2
cpython-722d3aec2eef7228c03ee12c53c75bb090c069e0.zip
Issue #15508: Fix the docstring for __import__ to not mention negative
'level' values and set its document default value to 0. Thanks to Arfrever Frehtes Taifersar Arahesis for filing the bug.
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r--Python/bltinmodule.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 80ac7f12936..3617b5a0560 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -195,7 +195,7 @@ builtin___import__(PyObject *self, PyObject *args, PyObject *kwds)
}
PyDoc_STRVAR(import_doc,
-"__import__(name, globals={}, locals={}, fromlist=[], level=-1) -> module\n\
+"__import__(name, globals={}, locals={}, fromlist=[], level=0) -> module\n\
\n\
Import a module. Because this function is meant for use by the Python\n\
interpreter and not for general use it is better to use\n\
@@ -208,8 +208,7 @@ empty list to emulate ``import name''.\n\
When importing a module from a package, note that __import__('A.B', ...)\n\
returns package A when fromlist is empty, but its submodule B when\n\
fromlist is not empty. Level is used to determine whether to perform \n\
-absolute or relative imports. -1 is the original strategy of attempting\n\
-both absolute and relative imports, 0 is absolute, a positive number\n\
+absolute or relative imports. 0 is absolute while a positive number\n\
is the number of parent directories to search relative to the current module.");