Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ cg.get_indexes_list()
#### Installation
Install required packages for testing using:
```bash
pip install pytest responses
pip install pytest-asyncio aioresponses responses
```

#### Usage
Expand Down
1 change: 1 addition & 0 deletions pycoingecko/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
from .api import CoinGeckoAPI
from .api_async import AsyncCoinGeckoAPI
from .version import __version__
9 changes: 4 additions & 5 deletions pycoingecko/api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import json
import orjson
import requests

from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry

Expand Down Expand Up @@ -48,15 +47,15 @@ def __request(self, url, params):
try:
response.raise_for_status()
# self._headers = response.headers
content = json.loads(response.content.decode('utf-8'))
content = orjson.loads(response.content.decode('utf-8'))
return content
except Exception as e:
# check if json (with error message) is returned
try:
content = json.loads(response.content.decode('utf-8'))
content = orjson.loads(response.content.decode('utf-8'))
raise ValueError(content)
# if no json
except json.decoder.JSONDecodeError:
except orjson.JSONDecodeError:
pass

raise
Expand Down
Loading