summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime “pep” Buquet <pep@bouah.net>2019-04-17 15:50:23 +0100
committerMaxime “pep” Buquet <pep@bouah.net>2019-04-17 15:50:23 +0100
commit74abc59dca3a79e4228d60e84e3ef031c19a2bee (patch)
tree7576c996a9b716ee9f5d32003d37c5ae0a86e8bd
parentbddca0c62c2e564855c90c2f5029f2746aafb4e7 (diff)
downloadpoezio-74abc59dca3a79e4228d60e84e3ef031c19a2bee.tar.gz
poezio-74abc59dca3a79e4228d60e84e3ef031c19a2bee.tar.bz2
poezio-74abc59dca3a79e4228d60e84e3ef031c19a2bee.tar.xz
poezio-74abc59dca3a79e4228d60e84e3ef031c19a2bee.zip
save_order, save: config option is not always a string
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
-rw-r--r--poezio/config.py2
-rw-r--r--poezio/core/commands.py6
2 files changed, 5 insertions, 3 deletions
diff --git a/poezio/config.py b/poezio/config.py
index 89b75d94..c87f881a 100644
--- a/poezio/config.py
+++ b/poezio/config.py
@@ -447,7 +447,7 @@ class Config(RawConfigParser):
RawConfigParser.set(self, section, option, value)
if not self.write_in_file(section, option, value):
return ('Unable to write in the config file', 'Error')
- if 'password' in option and 'eval_password' not in option:
+ if isinstance(option, str) and 'password' in option and 'eval_password' not in option:
value = '********'
return ("%s=%s" % (option, value), 'Info')
diff --git a/poezio/core/commands.py b/poezio/core/commands.py
index 34ac96b3..cc2869a0 100644
--- a/poezio/core/commands.py
+++ b/poezio/core/commands.py
@@ -614,7 +614,8 @@ class CommandCore:
theme.COLOR_INFORMATION_TEXT),
})
for option_name, option_value in section.items():
- if 'password' in option_name and 'eval_password' not in option_name:
+ if isinstance(option_name, str) and \
+ 'password' in option_name and 'eval_password' not in option_name:
option_value = '********'
lines.append(
'%s\x19%s}=\x19o%s' %
@@ -624,7 +625,8 @@ class CommandCore:
elif len(args) == 1:
option = args[0]
value = config.get(option)
- if 'password' in option and 'eval_password' not in option and value is not None:
+ if isinstance(option, str) and \
+ 'password' in option and 'eval_password' not in option and value is not None:
value = '********'
if value is None and '=' in option:
args = option.split('=', 1)