Skip to content

Commit 072dd08

Browse files
committed
Add support for Python 3.14
1 parent 4a010d5 commit 072dd08

File tree

5 files changed

+604
-4
lines changed

5 files changed

+604
-4
lines changed

dissect/target/helpers/compat/path_313.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,20 @@ def iterdir(self) -> Iterator[Self]:
230230
child_path._direntry = entry
231231
yield child_path
232232

233+
def _reset_class(self, paths: Iterator[_GlobberTargetPath]) -> Iterator[Self]:
234+
for p in paths:
235+
p.__class__ = self.__class__
236+
yield p
237+
233238
def glob(
234239
self, pattern: str, *, case_sensitive: bool | None = None, recurse_symlinks: bool = False
235240
) -> Iterator[Self]:
236241
"""Iterate over this subtree and yield all existing files (of any
237242
kind, including directories) matching the given relative pattern.
238243
"""
239-
return PathBase.glob(self, pattern, case_sensitive=case_sensitive, recurse_symlinks=recurse_symlinks)
244+
return self._reset_class(
245+
PathBase.glob(self, pattern, case_sensitive=case_sensitive, recurse_symlinks=recurse_symlinks)
246+
)
240247

241248
def rglob(
242249
self, pattern: str, *, case_sensitive: bool | None = None, recurse_symlinks: str = False

0 commit comments

Comments
 (0)