Skip to content

Commit

Permalink
Skip the setting of status_code if response is None
Browse files Browse the repository at this point in the history
  • Loading branch information
woctezuma committed Nov 20, 2023
1 parent 5de38c5 commit 82f7433
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/market_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,12 @@ def download_market_order_data(
except requests.exceptions.ConnectionError:
resp_data = None

status_code = resp_data.status_code if resp_data else None

else:
print(
f"No query to download market orders for {listing_hash}, because item name ID is unknown.",
)

resp_data = None
status_code = -1

if resp_data and resp_data.ok:
result = resp_data.json()
Expand Down Expand Up @@ -157,6 +154,7 @@ def download_market_order_data(

else:
if resp_data is not None:
status_code = resp_data.status_code
error_reason = resp_data.reason
if verbose:
print(f"Wrong status code ({status_code}): {error_reason}.")
Expand Down

0 comments on commit 82f7433

Please sign in to comment.