Explorar el Código

feat: Matplotlib缺少字体不引发错误

SongZihuan hace 3 años
padre
commit
36c0f61dc3
Se han modificado 1 ficheros con 1 adiciones y 2 borrados
  1. 1 2
      conf/matplotlib_conf.py

+ 1 - 2
conf/matplotlib_conf.py

@@ -12,7 +12,6 @@ except ImportError:
     pass
     pass
 else:
 else:
     if ConfigMatplotlib.matplotlib_font not in [f.name for f in fm.fontManager.ttflist]:
     if ConfigMatplotlib.matplotlib_font not in [f.name for f in fm.fontManager.ttflist]:
-        print(f"请安装 {ConfigMatplotlib.matplotlib_font} 字体, 字体列表: {fm.fontManager.ttflist}")
-        exit(1)
+        print(f"请安装 {ConfigMatplotlib.matplotlib_font} 字体")
     fm.rcParams["font.sans-serif"] = [ConfigMatplotlib.matplotlib_font]  # 配置中文字体
     fm.rcParams["font.sans-serif"] = [ConfigMatplotlib.matplotlib_font]  # 配置中文字体
     fm.rcParams["axes.unicode_minus"] = False  # 解决负号变豆腐块
     fm.rcParams["axes.unicode_minus"] = False  # 解决负号变豆腐块