Run Black+Flake8 on project
This commit is contained in:
committed by
Seth Michael Larson
parent
3a89b7bd01
commit
210fae23d0
@@ -264,7 +264,7 @@ class Elasticsearch(object):
|
||||
if len(cons) > 5:
|
||||
cons = cons[:5] + ["..."]
|
||||
return "<{cls}({cons})>".format(cls=self.__class__.__name__, cons=cons)
|
||||
except:
|
||||
except Exception:
|
||||
# probably operating on custom transport and connection_pool, ignore
|
||||
return super(Elasticsearch, self).__repr__()
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ def _escape(value):
|
||||
|
||||
# encode strings to utf-8
|
||||
if isinstance(value, string_types):
|
||||
if PY2 and isinstance(value, unicode):
|
||||
if PY2 and isinstance(value, unicode): # noqa: F821
|
||||
return value.encode("utf-8")
|
||||
if not PY2 and isinstance(value, str):
|
||||
return value.encode("utf-8")
|
||||
|
||||
Reference in New Issue
Block a user