verata-veritatis / pybit

Python3 API connector for Bybit's HTTP and Websockets APIs.
MIT License
114 stars 189 forks source link

fix AttributeError when kwargs not passed #55

Closed dextertd closed 2 years ago

dextertd commented 2 years ago

traceback error when calling an endpoint which does not pass kwargs (query=kwargs)

Traceback (most recent call last):
  File "/Users/uk09002ml/Projects/pybit/tests/test.py", line 27, in <module>
    print(session.api_key_info())
  File "/Users/uk09002ml/Projects/pybit/pybit/__init__.py", line 1362, in api_key_info
    return self._submit_request(
  File "/Users/uk09002ml/Projects/pybit/pybit/__init__.py", line 1702, in _submit_request
    query.pop('spot', '')
AttributeError: 'NoneType' object has no attribute 'pop'

Affected endpoints: api_key_info(), query_symbol(), any other which does not pass kwargs to _submit_request()