# Is there a duck-typing way to know we can't compile extensions? · Issue #80 · nedbat/coveragepy (original) (raw)
Originally reported by Zooko O'Whielacronx (Bitbucket: zooko, GitHub: zooko)
Is there a duck-typing way to know we can't compile extensions?
Yes! You try to build the extension and if it fails then you automatically fall back to using your pure-Python alternative. This way install will also succeed on a system without a C compiler, for example.
The example code that I crib from whenever I'm going to use this hack is simplejson:
http://simplejson.googlecode.com/svn/trunk/setup.py