Return True if there appears to be an executable compiler
()
| 73 | """ |
| 74 | |
| 75 | def have_compiler(): |
| 76 | """ Return True if there appears to be an executable compiler |
| 77 | """ |
| 78 | compiler = customized_ccompiler() |
| 79 | try: |
| 80 | cmd = compiler.compiler # Unix compilers |
| 81 | except AttributeError: |
| 82 | try: |
| 83 | if not compiler.initialized: |
| 84 | compiler.initialize() # MSVC is different |
| 85 | except (DistutilsError, ValueError): |
| 86 | return False |
| 87 | cmd = [compiler.cc] |
| 88 | try: |
| 89 | p = Popen(cmd, stdout=PIPE, stderr=PIPE) |
| 90 | p.stdout.close() |
| 91 | p.stderr.close() |
| 92 | p.wait() |
| 93 | except OSError: |
| 94 | return False |
| 95 | return True |
| 96 | |
| 97 | |
| 98 | HAVE_COMPILER = have_compiler() |
no test coverage detected