Run Black+Flake8 on project

This commit is contained in:
Seth Michael Larson
2020-03-09 13:54:47 -05:00
committed by Seth Michael Larson
parent 3a89b7bd01
commit 210fae23d0
15 changed files with 139 additions and 83 deletions
+1 -1
View File
@@ -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__()
+1 -1
View File
@@ -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")