Skip to content

Commit 563cc80

Browse files
committed
Assign a missing attr on CoinbaseAuth.
1 parent b400622 commit 563cc80

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

coinbase/__init__.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ def __init__(self, oauth2_credentials=None, api_key=None, api_secret=None):
8686

8787
self.oauth2_credentials = None
8888

89+
self.api_key = api_key
90+
self.api_secret = api_secret
91+
8992
if oauth2_credentials is not None:
9093
if not oauth2_supported:
9194
raise RuntimeError('oauth2 is not supported in this environment')
@@ -101,14 +104,9 @@ def __init__(self, oauth2_credentials=None, api_key=None, api_secret=None):
101104
except AccessTokenCredentialsError:
102105
self.token_expired = True
103106

104-
elif api_key and api_secret:
105-
self.api_key = api_key
106-
self.api_secret = api_secret
107-
108-
elif api_key:
107+
elif api_key and api_secret is None:
109108
warn("API key authentication without a secret has been deprecated"
110109
" by Coinbase- you should use a new key with a secret!")
111-
self.api_key = api_key
112110

113111
def _check_oauth_expired(self):
114112
"""

0 commit comments

Comments
 (0)