Skip to content

Remove raw traceback #1221

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 1, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions kafka/conn.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from random import shuffle, uniform
import socket
import time
import traceback
import sys

from kafka.vendor import six

Expand Down Expand Up @@ -614,8 +614,10 @@ def close(self, error=None):
"""
if self.state is ConnectionStates.DISCONNECTED:
if error is not None:
log.warning('%s: close() called on disconnected connection with error: %s', self, error)
traceback.print_stack()
if sys.version_info >= (3, 2):
log.warning('%s: close() called on disconnected connection with error: %s', self, error, stack_info=True)
else:
log.warning('%s: close() called on disconnected connection with error: %s', self, error)
return

log.info('%s: Closing connection. %s', self, error or '')
Expand Down