Skip to content

Commit

Permalink
Fix bug with KeyError
Browse files Browse the repository at this point in the history
  • Loading branch information
diogomatoschaves committed Feb 21, 2024
1 parent 02e4d08 commit 958c34f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions execution/exchanges/binance/futures/_trading.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ def stop_symbol_trading(self, pipeline_id, header=''):
self.close_pos(symbol, date=datetime.now(tz=pytz.UTC), header=header, pipeline_id=pipeline_id)
except NoUnits:
logging.info(header + "There's no position to be closed.")
except KeyError:
logging.info(header + "There's no position to be closed.")

Check warning on line 90 in execution/exchanges/binance/futures/_trading.py

View check run for this annotation

Codecov / codecov/patch

execution/exchanges/binance/futures/_trading.py#L89-L90

Added lines #L89 - L90 were not covered by tests

self.symbols.pop(symbol)

Expand Down

0 comments on commit 958c34f

Please sign in to comment.