mirror of
https://github.com/Textualize/rich.git
synced 2025-12-23 07:08:35 +00:00
Merge 3b9c79f7eb into f82a399d58
This commit is contained in:
commit
e699e6d0bb
2 changed files with 18 additions and 0 deletions
|
|
@ -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
11
test_my_fix.py
Normal 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("-------------------------------")
|
||||
Loading…
Add table
Add a link
Reference in a new issue