This commit is contained in:
Anandraj-prog 2025-12-06 14:41:04 +01:00 committed by GitHub
commit e699e6d0bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 0 deletions

View file

@ -1,5 +1,6 @@
import builtins
import collections
import pathlib
import dataclasses
import inspect
import os
@ -816,6 +817,12 @@ def traverse(
child_node.key_separator = "="
append(child_node)
pop_visited(obj_id)
# START of new code block
elif isinstance(obj, pathlib.Path):
node = Node(value_repr=repr(str(obj)))
# END of new code block
elif _safe_isinstance(obj, _CONTAINERS):
for container_type in _CONTAINERS:
if _safe_isinstance(obj, container_type):

11
test_my_fix.py Normal file
View file

@ -0,0 +1,11 @@
# test_my_fix.py
import pathlib
from rich.pretty import pprint
# Create a Path object to test
my_file_path = pathlib.Path("./my_folder/my_script.py")
# This will use the code you just modified!
print("--- Running test with the fix ---")
pprint(my_file_path)
print("-------------------------------")