projects
/
mudpy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Import a correct configparser for the interpreter
[mudpy.git]
/
lib
/
mudpy
/
data.py
diff --git
a/lib/mudpy/data.py
b/lib/mudpy/data.py
index
612b688
..
de76416
100644
(file)
--- a/
lib/mudpy/data.py
+++ b/
lib/mudpy/data.py
@@
-17,11
+17,15
@@
class DataFile:
def load(self):
"""Read a file and create elements accordingly."""
def load(self):
"""Read a file and create elements accordingly."""
- import ConfigParser
import mudpy.misc
import os
import os.path
import mudpy.misc
import os
import os.path
- self.data = ConfigParser.RawConfigParser()
+ # TODO: remove this check after the switch to py3k
+ try:
+ import configparser
+ except ImportError:
+ import ConfigParser as configparser
+ self.data = configparser.RawConfigParser()
self.modified = False
if os.access(self.filename, os.R_OK):
self.data.read(self.filename)
self.modified = False
if os.access(self.filename, os.R_OK):
self.data.read(self.filename)
@@
-154,7
+158,7
@@
class DataFile:
) != 0o0600:
os.chmod(self.filename, 0o0600)
) != 0o0600:
os.chmod(self.filename, 0o0600)
- # write it back sorted, instead of using
ConfigP
arser
+ # write it back sorted, instead of using
configp
arser
sections = self.data.sections()
sections.sort()
for section in sections:
sections = self.data.sections()
sections.sort()
for section in sections: