Skip to content

Commit

Permalink
Merge pull request #3527 from neutrinoceros/hotfix_notidentified_error
Browse files Browse the repository at this point in the history
ENH: improve formating and typing for YTUnidentifiedDataType exception
  • Loading branch information
matthewturk authored Oct 9, 2021
2 parents c6caf13 + 2452f4b commit bfb7557
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions yt/utilities/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ def __init__(self, filename, *args, **kwargs):
self.kwargs = kwargs

def __str__(self):
msg = [f"Could not determine input format from `'{self.filename}'"]
msg = f"Could not determine input format from {self.filename!r}"
if self.args:
msg.append(", ".join(str(a) for a in self.args))
msg += ", " + (", ".join(f"{a!r}" for a in self.args))
if self.kwargs:
msg.append(", ".join(f"{k}={v}" for k, v in self.kwargs.items()))
msg = ", ".join(msg) + "`."
msg += ", " + (", ".join(f"{k}={v!r}" for k, v in self.kwargs.items()))
return msg


Expand Down

0 comments on commit bfb7557

Please sign in to comment.