Jon Solow commited on
Commit
5ef0074
·
1 Parent(s): 3bd09fa

Fix mypy potential issue if no secrets toml loaded

Browse files
Files changed (1) hide show
  1. src/login.py +3 -0
src/login.py CHANGED
@@ -21,6 +21,9 @@ class HFFriendlyGSheetsConnection(GSheetsConnection):
21
  if secrets_singleton.load_if_toml_exists():
22
  connections_section = AttrDict(secrets_singleton)
23
 
 
 
 
24
  connections_copy = connections_section.to_dict()
25
  # in hf env the private key may need json loads
26
  private_key = connections_copy["private_key"]
 
21
  if secrets_singleton.load_if_toml_exists():
22
  connections_section = AttrDict(secrets_singleton)
23
 
24
+ if connections_section is None:
25
+ return AttrDict({})
26
+
27
  connections_copy = connections_section.to_dict()
28
  # in hf env the private key may need json loads
29
  private_key = connections_copy["private_key"]