summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordbgasaway <derekbga@gmail.com>2017-10-01 15:31:01 -0700
committerDana Powers <dana.powers@gmail.com>2017-10-01 15:31:01 -0700
commit7794ce8749ac6e4e0f2c0aae6c010dcef9befd0f (patch)
treeac4fe68112a439a6d085cf8d16d1bb5725d28df5
parentb1ae45c10d46e881492b0fd37f0919cac6d79224 (diff)
downloadkafka-python-7794ce8749ac6e4e0f2c0aae6c010dcef9befd0f.tar.gz
Remove raw traceback (#1221)
-rw-r--r--kafka/conn.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/kafka/conn.py b/kafka/conn.py
index af01efa..16e9238 100644
--- a/kafka/conn.py
+++ b/kafka/conn.py
@@ -7,7 +7,7 @@ import logging
from random import shuffle, uniform
import socket
import time
-import traceback
+import sys
from kafka.vendor import six
@@ -614,8 +614,10 @@ class BrokerConnection(object):
"""
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 '')