aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python/process_queue.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/python/process_queue.py b/python/process_queue.py
index ea0fe6e9..1735d26c 100644
--- a/python/process_queue.py
+++ b/python/process_queue.py
@@ -339,13 +339,17 @@ def process_list(
if trade_type == "bond" and fund == "SERCGMAST":
trades = [send_email(trade) for trade in trades]
if fund in ("SERCGMAST", "BOWDST") or trade_type in ("cds", "swaption"):
- buf = generate_csv(
- (t for t in trades if t.get("upload", True)), trade_type, fund,
- )
- dest = get_filepath(DAILY_DIR, trade_type, fund)
- if upload:
- upload_buf(buf, dest.name, fund)
- dest.write_bytes(buf)
+ try:
+ buf = generate_csv(
+ (t for t in trades if t.get("upload", True)), trade_type, fund,
+ )
+ except IOError:
+ pass
+ else:
+ dest = get_filepath(DAILY_DIR, trade_type, fund)
+ if upload:
+ upload_buf(buf, dest.name, fund)
+ dest.write_bytes(buf)
p.delete(key)