8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 46fd878 commit 154f515Copy full SHA for 154f515
config/sort-ini.py
@@ -1,20 +1,20 @@
1
#!/usr/bin/env python
2
3
import sys
4
-import ConfigParser
+import configparser
5
6
if len(sys.argv) > 1:
7
filename = sys.argv[1]
8
else:
9
filename = 'config.ini'
10
11
-oconfig = ConfigParser.RawConfigParser()
+oconfig = configparser.RawConfigParser()
12
oconfig.read(filename)
13
14
# This part will destroy the configuration if there's a crash while
15
# writing the output. We're in an GIT-controlled directory, so
16
# I didn't care enough to fix this.
17
-with open(filename, 'wb') as fd:
+with open(filename, 'w', encoding='utf-8') as fd:
18
# Copy of write() code that sorts output by section
19
if oconfig._defaults:
20
fd.write("[%s]\n" % DEFAULTSECT)
0 commit comments