0, /* tp_dictoffset */
(initproc)BaseContext_init, /* tp_init */
0, /* tp_alloc */
- PyType_GenericNew /* tp_new */
+ 0 /* tp_new */
};
static PyMethodDef module_methods[] = {
{
PyObject *module;
+ BaseContextType.tp_new = (newfunc)PyType_GenericNew;
if (PyType_Ready(&BaseContextType) < 0)
return;
ez_setup.use_setuptools()
from distutils.command.build_ext import build_ext
-from distutils.errors import CCompilerError
+from distutils.errors import CCompilerError, DistutilsError
from setuptools import setup, Extension, Feature
from inspect import getdoc
class optional_build_ext(build_ext):
+ def run(self):
+ try:
+ build_ext.run(self)
+ except DistutilsError, e:
+ self.compiler = None
+ self._setup_error = e
+
def build_extension(self, ext):
try:
+ if self.compiler is None:
+ raise self._setup_error
build_ext.build_extension(self, ext)
except CCompilerError, e:
print '=' * 79