Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Commit

Permalink
Merge pull request #51 from marcoboucas/bugfix-get-ele-type
Browse files Browse the repository at this point in the history
Fix bug when the type is not classic (not usual format) with default
  • Loading branch information
marcoboucas authored Feb 24, 2022
2 parents 41a1ff4 + 64240ac commit 7a7406a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion shortprint/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ def add_padding(text: str, current_padding: str) -> str:

def get_type(ele: Any) -> str:
"""Get the type of an element."""
return str(type(ele)).split("'")[1]
try:
return str(type(ele)).split("'")[1]
except IndexError:
return str(type(ele))


def display_caller(func_name: str = "shortprint"):
Expand Down

0 comments on commit 7a7406a

Please sign in to comment.