summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-07-08 11:02:17 +0200
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-07-08 11:02:17 +0200
commit07e13a1220ee8021ea3a09c1a72f1d09cb6e82b1 (patch)
tree342f3166967ece01b8a4ad2eb51fee109e0b9a53
parent19cc6229a207394a5a0f3e1181f48a32a11de9ef (diff)
downloadpoezio-07e13a1220ee8021ea3a09c1a72f1d09cb6e82b1.tar.gz
poezio-07e13a1220ee8021ea3a09c1a72f1d09cb6e82b1.tar.bz2
poezio-07e13a1220ee8021ea3a09c1a72f1d09cb6e82b1.tar.xz
poezio-07e13a1220ee8021ea3a09c1a72f1d09cb6e82b1.zip
Fix loading plugins.
-rw-r--r--poezio/plugin.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/poezio/plugin.py b/poezio/plugin.py
index 6f671535..b327e17d 100644
--- a/poezio/plugin.py
+++ b/poezio/plugin.py
@@ -42,7 +42,7 @@ class PluginConfig(config.Config):
def read(self):
"""Read the config file"""
- RawConfigParser.read(self, self.file_name)
+ RawConfigParser.read(self, str(self.file_name))
if not self.has_section(self.module_name):
self.add_section(self.module_name)
@@ -60,9 +60,8 @@ class PluginConfig(config.Config):
def write(self):
"""Write the config to the disk"""
try:
- fp = open(self.file_name, 'w')
- RawConfigParser.write(self, fp)
- fp.close()
+ with self.file_name.open('w') as fp:
+ RawConfigParser.write(self, fp)
return True
except IOError:
return False