Unverified Commit 9f5d5a53 authored by Julien Plu's avatar Julien Plu Committed by GitHub
Browse files

Fix the __getattr__ method in BatchEncoding (#4772)

parent 41a1d27c
...@@ -266,7 +266,10 @@ class BatchEncoding(UserDict): ...@@ -266,7 +266,10 @@ class BatchEncoding(UserDict):
) )
def __getattr__(self, item: str): def __getattr__(self, item: str):
try:
return self.data[item] return self.data[item]
except KeyError:
raise AttributeError
def keys(self): def keys(self):
return self.data.keys() return self.data.keys()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment