##// END OF EJS Templates
Backed out changeset 9b8f326731ac...
Backed out changeset 9b8f326731ac Unfortunately, disabling the rust extensions means newer Mercurial versions no longer have the persistent-nodemap feature enabled. This means a Mercurial 5.8.1 on RPM-based Linux distributions will no longer be able to read repositories created by a Mercurial 5.8 on RPM-based Linux distributions. This violates the compatibility rules (see https://www.mercurial-scm.org/wiki/CompatibilityRules ). For this reason, I have to backout this change. I'll try to find another solution to the 'hg purge' crashes. Differential Revision: https://phab.mercurial-scm.org/D10918

File last commit:

r45406:9f96beb9 default
r48266:25d36300 stable
Show More
debug.rs
24 lines | 822 B | application/rls-services+xml | RustLexer
Raphaël Gomès
rust-cpython: add `debug` module to expose debug information to Python...
r45018 // debug.rs
//
// Copyright 2020 Raphaël Gomès <rgomes@octobus.net>
//
// This software may be used and distributed according to the terms of the
// GNU General Public License version 2 or any later version.
//! Module to get debug information about Rust extensions.
use cpython::{PyDict, PyModule, PyResult, Python};
/// Create the module, with `__package__` given from parent
pub fn init_module(py: Python, package: &str) -> PyResult<PyModule> {
let dotted_name = &format!("{}.debug", package);
let m = PyModule::new(py, dotted_name)?;
m.add(py, "__package__", package)?;
m.add(py, "__doc__", "Rust debugging information")?;
let sys = PyModule::import(py, "sys")?;
let sys_modules: PyDict = sys.get(py, "modules")?.extract(py)?;
sys_modules.set_item(py, dotted_name, &m)?;
Ok(m)
}