Fix loading plugins.
This commit is contained in:
parent
19cc6229a2
commit
07e13a1220
1 changed files with 3 additions and 4 deletions
|
@ -42,7 +42,7 @@ class PluginConfig(config.Config):
|
||||||
|
|
||||||
def read(self):
|
def read(self):
|
||||||
"""Read the config file"""
|
"""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):
|
if not self.has_section(self.module_name):
|
||||||
self.add_section(self.module_name)
|
self.add_section(self.module_name)
|
||||||
|
|
||||||
|
@ -60,9 +60,8 @@ class PluginConfig(config.Config):
|
||||||
def write(self):
|
def write(self):
|
||||||
"""Write the config to the disk"""
|
"""Write the config to the disk"""
|
||||||
try:
|
try:
|
||||||
fp = open(self.file_name, 'w')
|
with self.file_name.open('w') as fp:
|
||||||
RawConfigParser.write(self, fp)
|
RawConfigParser.write(self, fp)
|
||||||
fp.close()
|
|
||||||
return True
|
return True
|
||||||
except IOError:
|
except IOError:
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Reference in a new issue