From f28b634e17e18e18ad3599ac695efd61a88a6d64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Honza=20Kr=C3=A1l?= Date: Tue, 28 Jun 2016 00:40:06 +0200 Subject: [PATCH] simplify init code --- elasticsearch/client/__init__.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/elasticsearch/client/__init__.py b/elasticsearch/client/__init__.py index 57cef549..73a19ffc 100644 --- a/elasticsearch/client/__init__.py +++ b/elasticsearch/client/__init__.py @@ -173,13 +173,14 @@ class Elasticsearch(object): # namespaced clients for compatibility with API names # use weakref to make GC's work a little easier - self.indices = IndicesClient(weakref.proxy(self)) - self.ingest = IngestClient(weakref.proxy(self)) - self.cluster = ClusterClient(weakref.proxy(self)) - self.cat = CatClient(weakref.proxy(self)) - self.nodes = NodesClient(weakref.proxy(self)) - self.snapshot = SnapshotClient(weakref.proxy(self)) - self.tasks = TasksClient(weakref.proxy(self)) + client = weakref.proxy(self) + self.indices = IndicesClient(client) + self.ingest = IngestClient(client) + self.cluster = ClusterClient(client) + self.cat = CatClient(client) + self.nodes = NodesClient(client) + self.snapshot = SnapshotClient(client) + self.tasks = TasksClient(client) def __repr__(self): try: