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
8188f585
Commit
8188f585
authored
Jul 25, 2011
by
Vinay Sajip
Browse files
Options
Browse Files
Download
Plain Diff
Fixes #12637: Merged fix from 3.2 and added test.
parents
acd9f7ce
45dedaaf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
Lib/logging/__init__.py
Lib/logging/__init__.py
+2
-1
Lib/test/test_logging.py
Lib/test/test_logging.py
+2
-0
No files found.
Lib/logging/__init__.py
View file @
8188f585
...
...
@@ -1442,7 +1442,8 @@ class Logger(Filterer):
c
=
c
.
parent
if
(
found
==
0
):
if
lastResort
:
lastResort
.
handle
(
record
)
if
record
.
levelno
>=
lastResort
.
level
:
lastResort
.
handle
(
record
)
elif
raiseExceptions
and
not
self
.
manager
.
emittedNoHandlerWarning
:
sys
.
stderr
.
write
(
"No handlers could be found for logger"
"
\
"
%s
\
"
\
n
"
%
self
.
name
)
...
...
Lib/test/test_logging.py
View file @
8188f585
...
...
@@ -2923,6 +2923,8 @@ class LastResortTest(BaseTest):
old_raise_exceptions = logging.raiseExceptions
try:
sys.stderr = sio = io.StringIO()
root.debug('This should not appear')
self.assertEqual(sio.getvalue(), '')
root.warning('This is your final chance!')
self.assertEqual(sio.getvalue(), 'This is your final chance!
\
n
')
#No handlers and no last resort, so 'No handlers' message
...
...
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