From 882840936ea16fa283a2dfcef8ad8b6d3fab9f08 Mon Sep 17 00:00:00 2001 From: Evert Lammerts Date: Thu, 19 Feb 2026 16:24:01 +0100 Subject: [PATCH] Remove static pystr --- src/duckdb_py/pyfilesystem.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/duckdb_py/pyfilesystem.cpp b/src/duckdb_py/pyfilesystem.cpp index 4a891536..4b7112eb 100644 --- a/src/duckdb_py/pyfilesystem.cpp +++ b/src/duckdb_py/pyfilesystem.cpp @@ -223,14 +223,12 @@ void PythonFilesystem::CreateDirectory(const string &directory, optional_ptr &callback, FileOpener *opener) { - static py::str DIRECTORY("directory"); - D_ASSERT(!py::gil_check()); PythonGILWrapper gil; bool nonempty = false; for (auto item : filesystem.attr("ls")(py::str(directory))) { - bool is_dir = DIRECTORY.equal(item["type"]); + bool is_dir = py::cast(item["type"]) == "directory"; callback(py::str(item["name"]), is_dir); nonempty = true; }