Skip to content

Commit 5406318

Browse files
bobfang1992Boyu Fang
and
Boyu Fang
authored
Python style format error (#64)
* Python style format error * Python style format error Co-authored-by: Boyu Fang <[email protected]>
1 parent 4363c95 commit 5406318

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/encoding_decoding.cpp

+2-11
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,8 @@ toml::array py_list_to_toml_array(const py::list &list) {
7373
toml::time time_value = it.cast<toml::time>();
7474
arr.push_back(time_value);
7575
} else {
76-
std::stringstream ss;
77-
#ifdef PYPY_VERSION
78-
// see
79-
// https://github.com/conda-forge/pytomlpp-feedstock/pull/1#issuecomment-972738986
80-
// and
81-
// https://github.com/pybind/pybind11/issues/3408#issuecomment-972752210
82-
ss << "not a valid type for conversion " << std::endl;
83-
#else
84-
ss << "not a valid type for conversion " << it << std::endl;
85-
#endif
86-
throw py::type_error(ss.str());
76+
throw py::type_error(
77+
py::str("not a valid type for conversion {}").format(it));
8778
}
8879
}
8980
return arr;

0 commit comments

Comments
 (0)