Skip to content

Commit 8bd4245

Browse files
author
Gerry Manoim
committed
remove pre 3.4 compat, change construction
1 parent 5b0bbaa commit 8bd4245

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

tests/test_to_object.cc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,19 +138,16 @@ TEST_F(to_object, filesystem_path) {
138138
std::filesystem::path test_path = "/tmp/";
139139
py::owned_ref ob = py::to_object(test_path);
140140
ASSERT_TRUE(ob);
141-
#if PY_VERSION_HEX >= 0x03040000
141+
142142
py::owned_ref ns = RUN_PYTHON(R"(
143143
from pathlib import Path
144144
py_path = Path("/tmp/")
145145
)");
146146
ASSERT_TRUE(ns);
147147

148-
py::borrowed_ref py_path_ob{PyDict_GetItemString(ns.get(), "py_path")};
148+
py::borrowed_ref py_path_ob = PyDict_GetItemString(ns.get(), "py_path");
149149
ASSERT_TRUE(py_path_ob);
150-
#else
151-
py::owned_ref py_path_ob = py::to_object("/tmp/");
152150

153-
#endif
154151
int eq = PyObject_RichCompareBool(ob.get(), py_path_ob.get(), Py_EQ);
155152
EXPECT_EQ(eq, 1);
156153
}

0 commit comments

Comments
 (0)