summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfuzzyman <devnull@localhost>2009-11-22 00:33:14 +0000
committerfuzzyman <devnull@localhost>2009-11-22 00:33:14 +0000
commit95d7cadd7167891c724bafdd9c9828dc640082e6 (patch)
treee398f10fd6c65b00e1d3e3b67ce4a72a12a44678
parentd9b3ecc236db2554482a88bc9502d95d983c6765 (diff)
downloadconfigobj-95d7cadd7167891c724bafdd9c9828dc640082e6.tar.gz
Implementation of any for Python 2.4
-rw-r--r--configobj.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/configobj.py b/configobj.py
index 90ad469..74a376b 100644
--- a/configobj.py
+++ b/configobj.py
@@ -86,6 +86,15 @@ MISSING = object()
__version__ = '4.7.0'
+try:
+ any
+except NameError:
+ def any(iterable):
+ for entry in iterable:
+ if entry:
+ return True
+ return False
+
__all__ = (
'__version__',
@@ -2246,6 +2255,8 @@ class ConfigObj(Section):
section.extra_values = unvalidated
if preserve_errors and not section._created:
+ # If the section wasn't created (i.e. it wasn't missing)
+ # then we can't return False, we need to preserve errors
ret_false = False
#
if ret_false and preserve_errors and out: