def _showWarning(self, message, category, filename, lineno,
file=None, line=None):
# Don't display repeat warnings
if str(message) in self.logged_warnings:
return
m = warnings.formatwarning(message, category, filename, lineno, line)
self.log.warning(m)
self.logged_warnings.add(str(message))
# Log this warning, but never display it to the user; it is
# nearly un-actionable.
if category == requestsexceptions.InsecurePlatformWarning:
return
if category == requestsexceptions.SNIMissingWarning:
return
# Disable InsecureRequestWarning when certificate validation is disabled
if not self.config.verify_ssl:
if category == requestsexceptions.InsecureRequestWarning:
return
self.error_queue.put(('Warning', m))
os.write(self.error_pipe, six.b('error\n'))
评论列表
文章目录