Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
626bc53e
Commit
626bc53e
authored
Jul 06, 2006
by
Andrew M. Kuchling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ImportWarning is now silent by default
parent
133d7a35
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
12 deletions
+5
-12
Doc/whatsnew/whatsnew25.tex
Doc/whatsnew/whatsnew25.tex
+5
-12
No files found.
Doc/whatsnew/whatsnew25.tex
View file @
626bc53e
...
...
@@ -1170,19 +1170,12 @@ a line like this near the top of the source file:
to include an
\file
{__
init
__
.py
}
module in a package directory.
Debugging this mistake can be confusing, and usually requires running
Python with the
\programopt
{
-v
}
switch to log all the paths searched.
In Python 2.5, a new
\exception
{
ImportWarning
}
warning is
rais
ed when
In Python 2.5, a new
\exception
{
ImportWarning
}
warning is
trigger
ed when
an import would have picked up a directory as a package but no
\file
{__
init
__
.py
}
was found. (Implemented by Thomas Wouters.)
To suppress these warnings, you can either supply
\code
{
\programopt
{
-W
}
'ignore:Not importing directory'
}
when running the Python
interpreter, or use the
\module
{
warnings
}
module to suppress the
message:
\begin{verbatim}
warnings.filterwarnings('ignore', 'Not importing directory',
ImportWarning)
\end{verbatim}
\file
{__
init
__
.py
}
was found. This warning is silently ignored by default;
provide the
\programopt
{
-Wd
}
option when running the Python executable
to display the warning message.
(Implemented by Thomas Wouters.)
\item
The list of base classes in a class definition can now be empty.
As an example, this is now legal:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment