diff options
author | Raymond Hettinger <python@rcn.com> | 2009-03-03 01:32:48 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2009-03-03 01:32:48 (GMT) |
commit | ff23e8cfe53692e67fea475fbc8a582acd5a53f8 (patch) | |
tree | 02a0df55ad6b1b3b946ec4ef78ab5e8e5276c8eb /Lib | |
parent | dcaf329e40923d22aefefeaf48babd422a5ad384 (diff) | |
download | cpython-ff23e8cfe53692e67fea475fbc8a582acd5a53f8.zip cpython-ff23e8cfe53692e67fea475fbc8a582acd5a53f8.tar.gz cpython-ff23e8cfe53692e67fea475fbc8a582acd5a53f8.tar.bz2 |
Fix bootstrapping problem where setup.py was using configparser
before _collections had been built.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/configparser.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/configparser.py b/Lib/configparser.py index f2e644c..7510a6e 100644 --- a/Lib/configparser.py +++ b/Lib/configparser.py @@ -87,8 +87,13 @@ ConfigParser -- responsible for parsing a list of write the configuration state in .ini format """ +try: + from collections import OrderedDict as _default_dict +except ImportError: + # fallback for setup.py which hasn't yet built _collections + _default_dict = dict + import re -from collections import OrderedDict __all__ = ["NoSectionError", "DuplicateSectionError", "NoOptionError", "InterpolationError", "InterpolationDepthError", @@ -216,7 +221,7 @@ class MissingSectionHeaderError(ParsingError): class RawConfigParser: - def __init__(self, defaults=None, dict_type=OrderedDict): + def __init__(self, defaults=None, dict_type=_default_dict): self._dict = dict_type self._sections = self._dict() self._defaults = self._dict() |