Skip to content

Commit c1a3c65

Browse files
committed
Clarify whether attribute or key in "no flag" errors
1 parent 61f431b commit c1a3c65

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

torch_np/_ndarray.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def __getattr__(self, attr: str):
5050
if attr.islower() and attr.upper() in FLAGS:
5151
return self[attr.upper()]
5252
else:
53-
raise AttributeError(f"No flag '{attr}'")
53+
raise AttributeError(f"No flag attribute '{attr}'")
5454

5555
def __getitem__(self, key):
5656
if key in SHORTHAND_TO_FLAGS.keys():
@@ -61,7 +61,7 @@ def __getitem__(self, key):
6161
except KeyError as e:
6262
raise NotImplementedError(f"{key=}") from e
6363
else:
64-
raise KeyError(f"No flag '{key}'")
64+
raise KeyError(f"No flag key '{key}'")
6565

6666

6767
##################### ndarray class ###########################

0 commit comments

Comments
 (0)