From fb8b55284ac0d57405e9f1bd19f41fb766535db0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Honza=20Kr=C3=A1l?= Date: Tue, 12 Jul 2016 22:46:15 +0200 Subject: [PATCH] Do not use weakref to refer to client --- elasticsearch/client/__init__.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/elasticsearch/client/__init__.py b/elasticsearch/client/__init__.py index 924a2704..2c90b61e 100644 --- a/elasticsearch/client/__init__.py +++ b/elasticsearch/client/__init__.py @@ -1,5 +1,4 @@ from __future__ import unicode_literals -import weakref import logging from ..transport import Transport @@ -172,15 +171,13 @@ class Elasticsearch(object): self.transport = transport_class(_normalize_hosts(hosts), **kwargs) # namespaced clients for compatibility with API names - # use weakref to make GC's work a little easier - 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) + self.indices = IndicesClient(self) + self.ingest = IngestClient(self) + self.cluster = ClusterClient(self) + self.cat = CatClient(self) + self.nodes = NodesClient(self) + self.snapshot = SnapshotClient(self) + self.tasks = TasksClient(self) def __repr__(self): try: