Skip to content

Commit fb8b552

Browse files
committed
Do not use weakref to refer to client
1 parent 7bdaa31 commit fb8b552

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

elasticsearch/client/__init__.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from __future__ import unicode_literals
2-
import weakref
32
import logging
43

54
from ..transport import Transport
@@ -172,15 +171,13 @@ def __init__(self, hosts=None, transport_class=Transport, **kwargs):
172171
self.transport = transport_class(_normalize_hosts(hosts), **kwargs)
173172

174173
# namespaced clients for compatibility with API names
175-
# use weakref to make GC's work a little easier
176-
client = weakref.proxy(self)
177-
self.indices = IndicesClient(client)
178-
self.ingest = IngestClient(client)
179-
self.cluster = ClusterClient(client)
180-
self.cat = CatClient(client)
181-
self.nodes = NodesClient(client)
182-
self.snapshot = SnapshotClient(client)
183-
self.tasks = TasksClient(client)
174+
self.indices = IndicesClient(self)
175+
self.ingest = IngestClient(self)
176+
self.cluster = ClusterClient(self)
177+
self.cat = CatClient(self)
178+
self.nodes = NodesClient(self)
179+
self.snapshot = SnapshotClient(self)
180+
self.tasks = TasksClient(self)
184181

185182
def __repr__(self):
186183
try:

0 commit comments

Comments
 (0)