mirror of
				https://github.com/python/cpython.git
				synced 2025-10-30 21:21:22 +00:00 
			
		
		
		
	Fix bootstrapping problem where setup.py was using configparser
before _collections had been built.
This commit is contained in:
		
							parent
							
								
									dcaf329e40
								
							
						
					
					
						commit
						ff23e8cfe5
					
				
					 1 changed files with 7 additions and 2 deletions
				
			
		|  | @ -87,8 +87,13 @@ | ||||||
|         write the configuration state in .ini format |         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 | import re | ||||||
| from collections import OrderedDict |  | ||||||
| 
 | 
 | ||||||
| __all__ = ["NoSectionError", "DuplicateSectionError", "NoOptionError", | __all__ = ["NoSectionError", "DuplicateSectionError", "NoOptionError", | ||||||
|            "InterpolationError", "InterpolationDepthError", |            "InterpolationError", "InterpolationDepthError", | ||||||
|  | @ -216,7 +221,7 @@ def __init__(self, filename, lineno, line): | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| class RawConfigParser: | class RawConfigParser: | ||||||
|     def __init__(self, defaults=None, dict_type=OrderedDict): |     def __init__(self, defaults=None, dict_type=_default_dict): | ||||||
|         self._dict = dict_type |         self._dict = dict_type | ||||||
|         self._sections = self._dict() |         self._sections = self._dict() | ||||||
|         self._defaults = self._dict() |         self._defaults = self._dict() | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Raymond Hettinger
						Raymond Hettinger