summaryrefslogtreecommitdiff
path: root/reconfigure/parsers
diff options
context:
space:
mode:
authorAndrew Shadura <andrew@shadura.me>2015-08-20 16:04:48 +0200
committerAndrew Shadura <andrew@shadura.me>2015-08-20 16:04:48 +0200
commit2989b4c027b3230b1778e3777d2cce53c89808d9 (patch)
treeeaae33622a6ced0a09a5610d79ab9d54e77a5a9f /reconfigure/parsers
parent1e93e1498efdfd85a599a7e831f4a3a55f78aa75 (diff)
Imported Upstream version 0.1.74+git49a20890
Diffstat (limited to 'reconfigure/parsers')
-rw-r--r--reconfigure/parsers/ini.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/reconfigure/parsers/ini.py b/reconfigure/parsers/ini.py
index 2f3b82e..2f95d33 100644
--- a/reconfigure/parsers/ini.py
+++ b/reconfigure/parsers/ini.py
@@ -1,3 +1,5 @@
+import six
+
from reconfigure.nodes import *
from reconfigure.parsers import BaseParser
from reconfigure.parsers.iniparse import INIConfig
@@ -67,7 +69,7 @@ class IniFileParser (BaseParser):
if hasattr(cp[sectionname], '_lines'):
self._set_comment(cp[sectionname]._lines[0], section.comment)
- data = str(cp) + '\n'
+ data = (str if six.PY3 else unicode)(cp) + u'\n'
if self.sectionless:
data = data.replace('[' + self.nullsection + ']\n', '')
return data