diff options
author | mathieui <mathieui@mathieui.net> | 2012-12-15 21:51:14 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2012-12-15 21:51:14 +0100 |
commit | 91975fd261412398ce0cc73561577e96b7378bd2 (patch) | |
tree | 3551afaa549269444ea25c09735dcd439dff43e6 /src/config.py | |
parent | 4f084671d3a345043b92495b6b4147dbad76428e (diff) | |
download | poezio-91975fd261412398ce0cc73561577e96b7378bd2.tar.gz poezio-91975fd261412398ce0cc73561577e96b7378bd2.tar.bz2 poezio-91975fd261412398ce0cc73561577e96b7378bd2.tar.xz poezio-91975fd261412398ce0cc73561577e96b7378bd2.zip |
Fix a TB on python < 3.2
Diffstat (limited to 'src/config.py')
-rw-r--r-- | src/config.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/config.py b/src/config.py index 0f375c88..abb39011 100644 --- a/src/config.py +++ b/src/config.py @@ -17,6 +17,7 @@ from os import environ, makedirs, path from shutil import copy2 from args import parse_args + class Config(RawConfigParser): """ load/save the config to a file @@ -24,7 +25,10 @@ class Config(RawConfigParser): def __init__(self, file_name): self.file_name = file_name RawConfigParser.__init__(self, None) - RawConfigParser.read(self, file_name, encoding='utf-8') + try: + RawConfigParser.read(self, file_name, encoding='utf-8') + except TypeError: # python < 3.2 sucks + RawConfigParser.read(self, file_name) # Check config integrity and fix it if it’s wrong for section in ('bindings', 'var'): if not self.has_section(section): |