Skip to content

Commit ae6b7bf

Browse files
committed
monitor: Skip AttributeError from inside read_cfg
Only catch the AttributeError from missing `read_player_cfg` method.
1 parent cfba6c6 commit ae6b7bf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

trakt_scrobbler/player_monitors/monitor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,12 @@ def autoload_cfg(cls):
134134
if not auto_keys:
135135
return monitor_cfg
136136
try:
137-
loaders = getattr(cls, "read_player_cfg")(auto_keys)
137+
read_cfg = getattr(cls, "read_player_cfg")
138138
except AttributeError:
139139
raise AutoloadError(param=auto_keys,
140140
extra_msg=f"Autoload not supported for {cls.name}.")
141+
try:
142+
loaders = read_cfg(auto_keys)
141143
except FileNotFoundError as e:
142144
raise AutoloadError(src=e.filename, extra_msg="File not found")
143145

0 commit comments

Comments
 (0)