Skip to content

Commit

Permalink
Merge c0d84b1 into 3ec71d3
Browse files Browse the repository at this point in the history
  • Loading branch information
ricfaith committed Sep 27, 2020
2 parents 3ec71d3 + c0d84b1 commit 06e5e4a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions oandapyV20/oandapyV20.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,19 @@ def __init__(self, access_token, environment="practice",
self.client.headers.update(headers)
logger.info("applying headers %s", ",".join(headers.keys()))

def __enter__(self):
return self

def __exit__(self, exc_type, exc_val, exc_tb):
self.close()

def close(self):
"""close.
explicit close of the session.
"""
self.client.close()

@property
def request_params(self):
"""request_params property."""
Expand Down

0 comments on commit 06e5e4a

Please sign in to comment.