Skip to content

Commit

Permalink
Prevent circular-reference (client->Repo->client) using weakref
Browse files Browse the repository at this point in the history
  • Loading branch information
zferentz committed Sep 10, 2017
1 parent 1647d79 commit f754510
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ari/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

"""ARI client library.
"""

import weakref
import json
import logging
import urlparse
Expand All @@ -28,7 +28,7 @@ def __init__(self, base_url, http_client):
self.swagger = swaggerpy.client.SwaggerClient(
url, http_client=http_client)
self.repositories = {
name: Repository(self, name, api)
name: Repository(weakref.proxy(self), name, api)
for (name, api) in self.swagger.resources.items()}

# Extract models out of the events resource
Expand Down

0 comments on commit f754510

Please sign in to comment.