Open
Description
Bug report
Bug description:
When compiling Python strings with the PyCF_MASK
, the CO_FUTURE_BARRY_AS_BDFL
is included and will be applied to the statement. It would be preferable if the PEP 401 easter egg was not applied to code compiled with the PyCF_MASK
compiler flag by default.
Example:
static const char code[] = "1 != 2";
static PyCompilerFlags compiler_flags = { PyCF_MASK | PyCF_SOURCE_IS_UTF8 };
PyObject* n = Py_CompileStringFlags(code, "<string>", Py_single_input, &compiler_flags);
Will result change the result to 1 <> 2
.
CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS, Windows