Skip to content

Commit

Permalink
Replaced raw status code with HTTPStatus enum
Browse files Browse the repository at this point in the history
  • Loading branch information
BilousVladyslav committed Apr 23, 2023
1 parent def455c commit d8ce169
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion steampy/login.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from time import time
from http import HTTPStatus
from base64 import b64encode

from rsa import encrypt, PublicKey
Expand Down Expand Up @@ -65,7 +66,7 @@ def _fetch_rsa_params(self, current_number_of_repetitions: int = 0) -> dict:
request_data = {'account_name': self.username}
response = self._api_call('GET', 'IAuthenticationService', 'GetPasswordRSAPublicKey', params=request_data)

if response.status_code == 200 and 'response' in response.json():
if response.status_code == HTTPStatus.OK and 'response' in response.json():
key_data = response.json()['response']
# Steam may return an empty "response" value even if the status is 200
if 'publickey_mod' in key_data and 'publickey_exp' in key_data and 'timestamp' in key_data:
Expand Down

0 comments on commit d8ce169

Please sign in to comment.