diff options
author | fuzzyman <devnull@localhost> | 2009-11-22 00:33:14 +0000 |
---|---|---|
committer | fuzzyman <devnull@localhost> | 2009-11-22 00:33:14 +0000 |
commit | 95d7cadd7167891c724bafdd9c9828dc640082e6 (patch) | |
tree | e398f10fd6c65b00e1d3e3b67ce4a72a12a44678 | |
parent | d9b3ecc236db2554482a88bc9502d95d983c6765 (diff) | |
download | configobj-95d7cadd7167891c724bafdd9c9828dc640082e6.tar.gz |
Implementation of any for Python 2.4
-rw-r--r-- | configobj.py | 11 |
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: |