8000 QueryList: Better object handling · vcs-python/libvcs@1c873a5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1c873a5

Browse files
committed
QueryList: Better object handling
1 parent 1efe871 commit 1c873a5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/libvcs/_internal/query_list.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,14 @@ def keygetter(
2929
sub_fields = path.split("__")
3030
dct = obj
3131
for sub_field in sub_fields:
32-
dct = dct[sub_field]
32+
if isinstance(dct, dict):
33+
dct = dct[sub_field]
34+
elif hasattr(dct, sub_field):
35+
dct = getattr(dct, sub_field)
3336
return dct
34-
except Exception:
37+
except Exception as e:
3538
traceback.print_stack()
39+
print(f"Above error was {e}")
3640
return None
3741

3842

0 commit comments

Comments
 (0)
0