From: Earnie <ea...@us...> - 2011-08-04 17:17:15
|
Jon wrote: > i'm also trying to get enough background info on this one to create a > fairly lightweight, python-only patch to the 2.7 codebase using > something similar to the following > >>>> import subprocess import re output = >>>> subprocess.check_output(['gcc', '-dumpspecs']) print >>>> re.search('no-cygwin', output) > None > > and isolate the mods to one of these two classes > > http://hg.python.org/cpython/file/65c412586901/Lib/distutils/cygwinccompiler.py#l85 > > http://hg.python.org/cpython/file/65c412586901/Lib/distutils/cygwinccompiler.py#l271 > > as i _think_ it may be more robust that `gcc --version` style > checks. > > do you see any problems with the `gcc -dumpspecs` idea or know of a > more reliable way? I'm just learning python myself and fortunately know just enough to understand what you're saying. I don't see a problem with the method other than perhaps someone modifying their local copy of the specs file wanting -mno-cygwin to work again. I don't see that happening often and the likelihood is near zero so go for it. I don't know of a "more reliable" way at runtime either; I suppose you could execute a simple build using the -mno-cygwin switch and check the exit code for failure but that seems a bit of overdone magic. Earnie |