rust-cpython: remove invalid __package__ attribute
authorYuya Nishihara <yuya@tcha.org>
Sun, 06 Jan 2019 11:29:44 +0900
changeset 41130 d43719bd01f0
parent 41129 074c72a38423
child 41131 486908e691be
rust-cpython: remove invalid __package__ attribute Since mercurial.rustext is a package, its __package__ should be, if set, "mercurial.rustext". AFAIK, we don't have to set this attribute manually as the rustext module will be imported by the system importer. https://stackoverflow.com/a/21233334/10435339
rust/hg-cpython/src/lib.rs
--- a/rust/hg-cpython/src/lib.rs	Mon Jan 07 19:03:23 2019 -0500
+++ b/rust/hg-cpython/src/lib.rs	Sun Jan 06 11:29:44 2019 +0900
@@ -35,7 +35,6 @@
     )?;
 
     let dotted_name: String = m.get(py, "__name__")?.extract(py)?;
-    m.add(py, "__package__", "mercurial")?;
     m.add(py, "ancestor", ancestors::init_module(py, &dotted_name)?)?;
     m.add(py, "GraphError", py.get_type::<exceptions::GraphError>())?;
     Ok(())