<s> import sys <EOL> try : <EOL> from setuptools import setup , Extension <EOL> except : <EOL> from distutils . core import setup , Extension , Command <EOL> from distutils . command . build_ext import build_ext <EOL> from distutils . errors import CCompilerError , DistutilsExecError , DistutilsPlatformError <EOL> include_dirs = [ ] <EOL> if sys . platform == '<STR_LIT:win32>' : <EOL> include_dirs . append ( '<STR_LIT>' ) <EOL> ext_errors = ( CCompilerError , DistutilsExecError , DistutilsPlatformError , IOError ) <EOL> else : <EOL> ext_errors = ( CCompilerError , DistutilsExecError , DistutilsPlatformError ) <EOL> class BuildFailed ( Exception ) : <EOL> pass <EOL> class ve_build_ext ( build_ext ) : <EOL> def run ( self ) : <EOL> try : <EOL> build_ext . run ( self ) <EOL> except DistutilsPlatformError , x : <EOL> raise BuildFailed ( ) <EOL> def build_extension ( self , ext ) : <EOL> try : <EOL> build_ext . build_extension ( self , ext ) <EOL> except ext_errors , x : <EOL> raise BuildFailed ( ) <EOL> def run_setup ( with_binary ) : <EOL> if with_binary : <EOL> extensions = dict ( <EOL> ext_modules = [ <EOL> Extension ( '<STR_LIT>' , <EOL> sources = [ '<STR_LIT>' ] , <EOL> include_dirs = include_dirs , <EOL> ) <EOL> ] , <EOL> cmdclass = dict ( build_ext = ve_build_ext ) <EOL> ) <EOL> else : <EOL> extensions = dict ( ) <EOL> setup ( name = '<STR_LIT>' , <EOL> version = '<STR_LIT>' , <EOL> description = '<STR_LIT>' , <EOL> author = [ '<STR_LIT>' ] , <EOL> author_email = [ '<STR_LIT>' ] , <EOL> url = '<STR_LIT>' , <EOL> license = '<STR_LIT>' , <EOL> packages = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] , <EOL> package_dir = { '<STR_LIT>' : '<STR_LIT:src>' } , <EOL> classifiers = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' <EOL> ] , <EOL> ** extensions <EOL> ) <EOL> try : <EOL> run_setup ( True ) <EOL> except BuildFailed : <EOL> print <EOL> print '<STR_LIT:*>' * <NUM_LIT> <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print '<STR_LIT:*>' * <NUM_LIT> <EOL> print <EOL> run_setup ( False ) </s>
