Skip to content

Commit 50013d1

Browse files
committed
config.types: document empty except AttributeError clause
Fixes CodeQL py/empty-except alert.
1 parent 8a1a998 commit 50013d1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sopel/config/types.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,10 @@ def configure_setting(self, name, prompt, default=NO_DEFAULT):
101101
attribute = getattr(self.__class__, name)
102102
if default is NO_DEFAULT and not attribute.is_secret:
103103
try:
104+
# get current value of this setting to use as prompt default
104105
default = getattr(self, name)
105106
except AttributeError:
107+
# there is no current value; that's OK
106108
pass
107109
except ValueError:
108110
print('The configured value for this option was invalid.')

0 commit comments

Comments
 (0)