Patch #602345 by Neal Norwitz and me: add -B option and PYTHONDONTWRITEBYTECODE envvar to skip writing bytecode.
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 2a6a8c3..bd551b5 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -1128,6 +1128,9 @@
v = Py_BuildValue("(ssz)", "CPython", branch, svn_revision);
PyDict_SetItemString(sysdict, "subversion", v);
Py_XDECREF(v);
+ PyDict_SetItemString(sysdict, "dont_write_bytecode",
+ v = PyBool_FromLong(Py_DontWriteBytecodeFlag));
+ Py_XDECREF(v);
/*
* These release level checks are mutually exclusive and cover
* the field, so don't get too fancy with the pre-processor!