[Zconfig] SVN: ZConfig/trunk/ZConfig/schemaless. make the tests
pass under Python 2.3.5
Fred L. Drake, Jr.
fdrake at gmail.com
Thu Aug 30 23:50:28 EDT 2007
Log message for revision 79393:
make the tests pass under Python 2.3.5
Changed:
U ZConfig/trunk/ZConfig/schemaless.py
U ZConfig/trunk/ZConfig/schemaless.txt
-=-
Modified: ZConfig/trunk/ZConfig/schemaless.py
===================================================================
--- ZConfig/trunk/ZConfig/schemaless.py 2007-08-31 03:17:44 UTC (rev 79392)
+++ ZConfig/trunk/ZConfig/schemaless.py 2007-08-31 03:50:27 UTC (rev 79393)
@@ -65,7 +65,9 @@
result.append(start)
pre += ' '
- for name, values in sorted(self.items()):
+ lst = list(self.items())
+ lst.sort()
+ for name, values in lst:
for value in values:
result.append('%s%s %s' % (pre, name, value))
Modified: ZConfig/trunk/ZConfig/schemaless.txt
===================================================================
--- ZConfig/trunk/ZConfig/schemaless.txt 2007-08-31 03:17:44 UTC (rev 79392)
+++ ZConfig/trunk/ZConfig/schemaless.txt 2007-08-31 03:50:27 UTC (rev 79393)
@@ -63,7 +63,9 @@
Traceback (most recent call last):
KeyError: 'no-such-key-in-the-config'
- >>> sorted(config)
+ >>> lst = list(config)
+ >>> lst.sort()
+ >>> lst
['another-key', 'some-key']
There is also a ``sections`` attribute that lists child sections::
@@ -86,7 +88,9 @@
Traceback (most recent call last):
KeyError: 'no-such-key-in-the-config'
- >>> sorted(section)
+ >>> lst = list(section)
+ >>> lst.sort()
+ >>> lst
['key1', 'key2']
Child sections are again available via the ``sections`` attribute::
More information about the ZConfig
mailing list