Skip to content

Commit 5c9b1ba

Browse files
committed
Use 'compat.PY2' for version detection
1 parent beefd49 commit 5c9b1ba

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

elasticsearch/connection/base.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,13 @@
2424
import warnings
2525
from platform import python_version
2626

27-
import six
28-
2927
try:
3028
import simplejson as json
3129
except ImportError:
3230
import json
3331

3432
from .. import __version__, __versionstr__
33+
from ..compat import PY2
3534
from ..exceptions import (
3635
HTTP_EXCEPTIONS,
3736
ElasticsearchWarning,
@@ -358,7 +357,7 @@ def loggable_response_body(response):
358357
# If 'response' isn't unicode we need to try converting it to
359358
# unicode otherwise it's likely binary so should be encoded
360359
# properly. On Python 3.x this works out fine.
361-
if six.PY2 and not isinstance(response, unicode): # noqa
360+
if PY2 and not isinstance(response, unicode): # noqa
362361
try:
363362
response = response.decode("utf-8")
364363
except (AttributeError, UnicodeError):

0 commit comments

Comments
 (0)