public static PyObject compile(PyObject source, String filename, CompileMode kind,
CompilerFlags cflags, boolean dont_inherit) {
cflags = Py.getCompilerFlags(cflags, dont_inherit);
mod ast = py2node(source);
if (ast == null) {
if (!(source instanceof PyString)) {
throw Py.TypeError("expected a readable buffer object");
}
cflags.source_is_utf8 = source instanceof PyUnicode;