File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
include/openPMD/binding/python Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ pythonObjectAsMpiComm(pybind11::object &comm)
9494 e_t ::is_not_an_mpi_communicator};
9595 // only checks same layout, e.g. an `int` in `PyObject` could pass this
9696 if (!py::isinstance<py::class_<openPMD_PyMPIIntracommObject> >(
97- comm. get_type ( )))
97+ py::type::of (comm )))
9898 // TODO add mpi4py version from above import check to error message
9999 return e{
100100 " comm has unexpected type layout in " + comm_str +
Original file line number Diff line number Diff line change @@ -275,7 +275,7 @@ template <typename RequestedType>
275275bool setAttributeFromObject_default (
276276 Attributable &attr, std::string const &key, py::object &obj)
277277{
278- if (std::string (py::str (obj. get_type ( ))) == " <class 'list'>" )
278+ if (std::string (py::str (py::type::of (obj ))) == " <class 'list'>" )
279279 {
280280 using ListType = std::vector<RequestedType>;
281281 return attr.setAttribute <ListType>(key, obj.cast <ListType>());
@@ -289,7 +289,7 @@ bool setAttributeFromObject_default(
289289bool setAttributeFromObject_double (
290290 Attributable &attr, std::string const &key, py::object &obj)
291291{
292- if (std::string (py::str (obj. get_type ( ))) == " <class 'list'>" )
292+ if (std::string (py::str (py::type::of (obj ))) == " <class 'list'>" )
293293 {
294294 using ListType = std::vector<double >;
295295 using ArrayType = std::array<double , 7 >;
@@ -342,7 +342,7 @@ std::optional<TargetType> tryCast(py::object const &obj)
342342 {
343343 TargetType val{};
344344 auto python_val = py::cast (std::move (val));
345- if (!py::isinstance (obj, python_val. get_type ( )))
345+ if (!py::isinstance (obj, py::type::of (python_val )))
346346 {
347347 return std::nullopt ;
348348 }
You can’t perform that action at this time.
0 commit comments