##// END OF EJS Templates
tweak-default: no longer enable the experimental return code...
tweak-default: no longer enable the experimental return code The change is quite new and undocumented (since it is experimental) so it seems premature to make it available in tweak default. In addition, I am not sure the new return code are frozen yet (eg: some of the initial feedback have not been incorporated). Before the release I doubled check (probably with Martin) that they were not enabled by default and got replied that they were only enabled in the tests. Have I been aware that they have been also enabled in tweak default I would I have lobbied to delay that. I discovered they were in tweak default from users feedback. They found it an unpleasant and unexpected surprise of 5.7. So I suggest we no enable enable this experimental feature for Mercurial 5.7 and revisit this later, when the feature will be more mature. Differential Revision: https://phab.mercurial-scm.org/D9975

File last commit:

r46195:426294d0 default
r47216:839cacdf stable
Show More
main.rs
39 lines | 1.4 KiB | application/rls-services+xml | RustLexer
use pyembed::MainPythonInterpreter;
// Include an auto-generated file containing the default
// `pyembed::PythonConfig` derived by the PyOxidizer configuration file.
//
// If you do not want to use PyOxidizer to generate this file, simply
// remove this line and instantiate your own instance of
// `pyembed::PythonConfig`.
include!(env!("PYOXIDIZER_DEFAULT_PYTHON_CONFIG_RS"));
fn main() {
// The following code is in a block so the MainPythonInterpreter is
// destroyed in an orderly manner, before process exit.
let code = {
// Load the default Python configuration as derived by the PyOxidizer
// config file used at build time.
let config = default_python_config();
// Construct a new Python interpreter using that config, handling any
// errors from construction.
match MainPythonInterpreter::new(config) {
Ok(mut interp) => {
// And run it using the default run configuration as specified
// by the configuration. If an uncaught Python
// exception is raised, handle it.
// This includes the special SystemExit, which is a request to
// terminate the process.
interp.run_as_main()
}
Err(msg) => {
eprintln!("{}", msg);
1
}
}
};
// And exit the process according to code execution results.
std::process::exit(code);
}