Backwards-compatible check for Python none object in C++.

Refs #7019
Merge branch 'feature/7019_cpp_runpythonscript' into develop