From patchwork Sun Jan 6 03:53:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: rust-cpython: remove invalid __package__ attribute From: Yuya Nishihara X-Patchwork-Id: 37489 Message-Id: <25c142f679c23fbc210d.1546746826@mimosa> To: mercurial-devel@mercurial-scm.org Date: Sun, 06 Jan 2019 12:53:46 +0900 # HG changeset patch # User Yuya Nishihara # Date 1546741784 -32400 # Sun Jan 06 11:29:44 2019 +0900 # Node ID 25c142f679c23fbc210d5bcbdf2f913e4dd55402 # Parent 536c83535cbdafdfe060cea2b8c80b0789863227 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 diff --git a/rust/hg-cpython/src/lib.rs b/rust/hg-cpython/src/lib.rs --- a/rust/hg-cpython/src/lib.rs +++ b/rust/hg-cpython/src/lib.rs @@ -35,7 +35,6 @@ py_module_initializer!(rustext, initrust )?; 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::())?; Ok(())