This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author dmalcolm
Recipients brett.cannon, dmalcolm, vstinner
Date 2012-08-09.21:07:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1344546393.25885.22.camel@surprise>
In-reply-to <1344546257.44.0.487087180764.issue15610@psf.upfronthosting.co.za>
Content
On Thu, 2012-08-09 at 21:04 +0000, STINNER Victor wrote:
> STINNER Victor added the comment:
> 
> Oh, I didn't realize that the documentation says that the default value is -1.
> http://docs.python.org/library/functions.html#__import__
> 
> "level specifies whether to use absolute or relative imports. The default is -1 which indicates both absolute and relative imports will be attempted. 0 means only perform absolute imports. Positive values for level indicate the number of parent directories to search relative to the directory of the module calling __import__()."
That's the python 2 documentation

The 3.3 docs here:
  http://docs.python.org/dev/library/functions.html#__import__
say "Changed in version 3.3: Negative values for level are no longer
supported (which also changes the default value to 0)."

> We should probably tolerate -1, or just drop the exception.
History
Date User Action Args
2012-08-09 21:07:09dmalcolmsetrecipients: + dmalcolm, brett.cannon, vstinner
2012-08-09 21:07:08dmalcolmlinkissue15610 messages
2012-08-09 21:07:08dmalcolmcreate