diff options
| author | Éric Araujo <merwok@netwok.org> | 2011-09-01 04:29:11 (GMT) |
|---|---|---|
| committer | Éric Araujo <merwok@netwok.org> | 2011-09-01 04:29:11 (GMT) |
| commit | 336b4e4ff3edea750eb79bc59dab0f63141a1caa (patch) | |
| tree | a11e7805f34c0ec9f1a14d1c67fff9dbf553af30 /Lib/packaging/config.py | |
| parent | b8edbdf4b986048e48b689baf339023c38384ae7 (diff) | |
| download | cpython-336b4e4ff3edea750eb79bc59dab0f63141a1caa.zip cpython-336b4e4ff3edea750eb79bc59dab0f63141a1caa.tar.gz cpython-336b4e4ff3edea750eb79bc59dab0f63141a1caa.tar.bz2 | |
Minor improvement to extensions section in setup.cfg.
The right-hand part in [extension: foo] is now used as the name of the
extension module. (I changed the separator from = to : and allowed
whitespace to make the sections look nicer.)
Diffstat (limited to 'Lib/packaging/config.py')
| -rw-r--r-- | Lib/packaging/config.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Lib/packaging/config.py b/Lib/packaging/config.py index 83e97a9..b138d08 100644 --- a/Lib/packaging/config.py +++ b/Lib/packaging/config.py @@ -251,13 +251,16 @@ class Config: ext_modules = self.dist.ext_modules for section_key in content: - labels = section_key.split('=') + # no str.partition in 2.4 :( + labels = section_key.split(':') if len(labels) == 2 and labels[0] == 'extension': - # labels[1] not used from now but should be implemented - # for extension build dependency values_dct = content[section_key] + if 'name' in values_dct: + raise PackagingOptionError( + 'extension name should be given as [extension: name], ' + 'not as key') ext_modules.append(Extension( - values_dct.pop('name'), + labels[1].strip(), _pop_values(values_dct, 'sources'), _pop_values(values_dct, 'include_dirs'), _pop_values(values_dct, 'define_macros'), |
