From 4333a412e993f472aaac3c8dbfb86b190bc7e2df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=9D=E5=B7=9D?= Date: Fri, 7 Jan 2022 14:14:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E5=AF=B9=E5=A4=96?= =?UTF-8?q?=E6=8A=95=E8=B5=84=E6=95=B0=E9=87=8F=E6=B8=85=E6=B4=97=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rating/scripts/report/company_profile.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rating/scripts/report/company_profile.py b/rating/scripts/report/company_profile.py index 852e3c3..ba040df 100644 --- a/rating/scripts/report/company_profile.py +++ b/rating/scripts/report/company_profile.py @@ -209,7 +209,10 @@ def outbound_investment(param): # 年限 part_01['year_03'] = data_02['资产负债表'][0]['报告期'][:4] # 对外投资数量 - part_01['subsidiary_total_number'] = len(data_01['result']) + try: + part_01['subsidiary_total_number'] = len(data_01['result']) + except KeyError: + part_01['subsidiary_total_number'] = 0 # 投资总金额 part_01['investment_total_amount'] = str(calculate_amount(data_01['result'])['amount'])