Skip to content

Commit 740d984

Browse files
author
todd
committed
Eliminate unnecessary use of missing_data
1 parent 033f4dd commit 740d984

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sysdata/futures/instruments.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ def update_slippage_costs(self, instrument_code: str, new_slippage: float):
4242
def upate_meta_data(self, instrument_code: str, meta_name: str, new_value):
4343
instrument_object = self.get_instrument_data(instrument_code)
4444
existing_meta_data = instrument_object.meta_data
45-
existing_meta_data_value = getattr(existing_meta_data, meta_name, missing_data)
46-
if existing_meta_data_value is missing_data:
45+
try:
46+
existing_meta_data_value = getattr(existing_meta_data, meta_name)
47+
except AttributeError:
4748
raise Exception(
4849
"Meta data %s does not exist for instrument %s"
4950
% (meta_name, instrument_code)

0 commit comments

Comments
 (0)