Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1e86beb

Browse files
committed
One-off "No handlers..." error message only raised if raiseExceptions is set.
1 parent db85ed5 commit 1e86beb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/logging/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,7 @@ def callHandlers(self, record):
11231123
c = None #break out
11241124
else:
11251125
c = c.parent
1126-
if (found == 0) and not self.manager.emittedNoHandlerWarning:
1126+
if (found == 0) and raiseExceptions and not self.manager.emittedNoHandlerWarning:
11271127
sys.stderr.write("No handlers could be found for logger"
11281128
" \"%s\"\n" % self.name)
11291129
self.manager.emittedNoHandlerWarning = 1

0 commit comments

Comments
 (0)