From 600466e12f69af8a0e465e7679a3c64377ffba7b Mon Sep 17 00:00:00 2001 From: David Hewitt <1939362+davidhewitt@users.noreply.github.com> Date: Sun, 27 Dec 2020 19:36:12 +0000 Subject: [PATCH] pyclass: fix deprecation warning for no __module__ attribute --- CHANGELOG.md | 1 + src/pyclass.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac2b3024..70a84063 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Stop including `Py_TRACE_REFS` config setting automatically if `Py_DEBUG` is set on Python 3.8 and up. [#1334](https://github.com/PyO3/pyo3/pull/1334) - Remove `#[deny(warnings)]` attribute (and instead refuse warnings only in CI). [#1340](https://github.com/PyO3/pyo3/pull/1340) - Deprecate FFI definitions `PyEval_CallObjectWithKeywords`, `PyEval_CallObject`, `PyEval_CallFunction`, `PyEval_CallMethod` when building for Python 3.9. [#1338](https://github.com/PyO3/pyo3/pull/1338) +- Fix deprecation warning for missing `__module__` with `#[pyclass]`. [#1343](https://github.com/PyO3/pyo3/pull/1343) ## [0.13.0] - 2020-12-22 ### Packaging diff --git a/src/pyclass.rs b/src/pyclass.rs index 67f5ba6e..9f2deca6 100644 --- a/src/pyclass.rs +++ b/src/pyclass.rs @@ -153,7 +153,7 @@ fn tp_doc() -> PyResult> { fn get_type_name(module_name: Option<&str>) -> PyResult<*mut c_char> { Ok(match module_name { Some(module_name) => CString::new(format!("{}.{}", module_name, T::NAME))?.into_raw(), - None => CString::new(T::NAME)?.into_raw(), + None => CString::new(format!("builtins.{}", T::NAME))?.into_raw(), }) }