diff options
author | Tarek Ziadé <ziade.tarek@gmail.com> | 2010-01-29 11:41:03 (GMT) |
---|---|---|
committer | Tarek Ziadé <ziade.tarek@gmail.com> | 2010-01-29 11:41:03 (GMT) |
commit | edacea30e457e151611a9fe560120cedb3bdc527 (patch) | |
tree | 3227e5e1c060cce48b00d34b9ae46571f079e2fb /Lib/distutils/extension.py | |
parent | 82b83985832a0b1922aa86261f764b12a7237ac5 (diff) | |
download | cpython-edacea30e457e151611a9fe560120cedb3bdc527.zip cpython-edacea30e457e151611a9fe560120cedb3bdc527.tar.gz cpython-edacea30e457e151611a9fe560120cedb3bdc527.tar.bz2 |
Merged revisions 77704,77752 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r77704 | tarek.ziade | 2010-01-23 10:23:15 +0100 (Sat, 23 Jan 2010) | 1 line
taking sysconfig out of distutils
........
r77752 | tarek.ziade | 2010-01-26 00:19:56 +0100 (Tue, 26 Jan 2010) | 1 line
switched the call order so this call works without suffering from issue #7774
........
Diffstat (limited to 'Lib/distutils/extension.py')
-rw-r--r-- | Lib/distutils/extension.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Lib/distutils/extension.py b/Lib/distutils/extension.py index 10aaf7c..ebe5437 100644 --- a/Lib/distutils/extension.py +++ b/Lib/distutils/extension.py @@ -134,14 +134,17 @@ class Extension: def read_setup_file(filename): """Reads a Setup file and returns Extension instances.""" - from distutils.sysconfig import (parse_makefile, expand_makefile_vars, + warnings.warn('distutils.extensions.read_setup_file is deprecated. ' + 'It will be removed in the next Python release.') + _sysconfig = __import__('sysconfig') + from distutils.sysconfig import (expand_makefile_vars, _variable_rx) from distutils.text_file import TextFile from distutils.util import split_quoted # First pass over the file to gather "VAR = VALUE" assignments. - vars = parse_makefile(filename) + vars = _sysconfig._parse_makefile(filename) # Second pass to gobble up the real content: lines of the form # <module> ... [<sourcefile> ...] [<cpparg> ...] [<library> ...] @@ -161,7 +164,10 @@ def read_setup_file(filename): file.warn("'%s' lines not handled yet" % line) continue - line = expand_makefile_vars(line, vars) + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + line = expand_makefile_vars(line, vars) + words = split_quoted(line) # NB. this parses a slightly different syntax than the old |