Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions config/sort-ini.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
#!/usr/bin/env python

import sys
import ConfigParser
import configparser

if len(sys.argv) > 1:
filename = sys.argv[1]
else:
filename = 'config.ini'

oconfig = ConfigParser.RawConfigParser()
oconfig = configparser.RawConfigParser()
oconfig.read(filename)

# This part will destroy the configuration if there's a crash while
# writing the output. We're in an GIT-controlled directory, so
# I didn't care enough to fix this.
with open(filename, 'wb') as fd:
with open(filename, 'w', encoding='utf-8') as fd:
# Copy of write() code that sorts output by section
if oconfig._defaults:
fd.write("[%s]\n" % DEFAULTSECT)
Expand Down