diff --git a/CHANGELOG b/CHANGELOG index 4508dce..342dd55 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,6 @@ 1.1.4 - Locks mutex when sending websocket messages +- Fix py3.8 stricter linting errors 1.1.3 - Adds ability to specify channel_filter in client diff --git a/bfxapi/rest/bfx_rest.py b/bfxapi/rest/bfx_rest.py index 8e2eb56..4125ea6 100644 --- a/bfxapi/rest/bfx_rest.py +++ b/bfxapi/rest/bfx_rest.py @@ -41,7 +41,7 @@ class BfxRest: async with aiohttp.ClientSession() as session: async with session.get(url) as resp: text = await resp.text() - if resp.status is not 200: + if resp.status != 200: raise Exception('GET {} failed with status {} - {}' .format(url, resp.status, text)) parsed = json.loads(text, parse_float=self.parse_float) diff --git a/bfxapi/websockets/order_manager.py b/bfxapi/websockets/order_manager.py index 0033813..9ec3c93 100644 --- a/bfxapi/websockets/order_manager.py +++ b/bfxapi/websockets/order_manager.py @@ -131,19 +131,19 @@ class OrderManager: flags = calculate_order_flags(hidden, close, reduce_only, post_only, oco) payload['flags'] = flags # add extra parameters - if price_trailing is not None: + if price_trailing != None: payload['price_trailing'] = price_trailing - if price_aux_limit is not None: + if price_aux_limit != None: payload['price_aux_limit'] = price_aux_limit - if oco_stop_price is not None: + if oco_stop_price != None: payload['price_oco_stop'] = str(oco_stop_price) - if time_in_force is not None: + if time_in_force != None: payload['tif'] = time_in_force - if gid is not None: + if gid != None: payload['gid'] = gid - if leverage is not None: + if leverage != None: payload['lev'] = str(leverage) - if aff_code is not None: + if aff_code != None: payload['meta']['aff_code'] = str(aff_code) # submit the order self.pending_orders[cid] = payload @@ -180,19 +180,19 @@ class OrderManager: """ self._create_callback(orderId, onConfirm, self.pending_update_confirm_callbacks) payload = {"id": orderId} - if price is not None: + if price != None: payload['price'] = str(price) - if amount is not None: + if amount != None: payload['amount'] = str(amount) - if delta is not None: + if delta != None: payload['delta'] = str(delta) - if price_aux_limit is not None: + if price_aux_limit != None: payload['price_aux_limit'] = str(price_aux_limit) - if price_trailing is not None: + if price_trailing != None: payload['price_trailing'] = str(price_trailing) - if time_in_force is not None: + if time_in_force != None: payload['time_in_force'] = str(time_in_force) - if leverage is not None: + if leverage != None: payload['lev'] = str(leverage) flags = calculate_order_flags( hidden, close, reduce_only, post_only, False)