-
Notifications
You must be signed in to change notification settings - Fork 608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix tqdm #1629
Fix tqdm #1629
Conversation
src/huggingface_hub/utils/tqdm.py
Outdated
def __delattr__(self, attr): | ||
"""fix for https://github.com/huggingface/huggingface_hub/issues/1603""" | ||
try: | ||
del self.__dict__[attr] | ||
except KeyError: | ||
if attr != "_lock": | ||
raise AttributeError(attr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to use the "real" underlying __delattr__
and raise the default exception generated by it instead of creating a new AttributeError(attr)
that is less verbose.
def __delattr__(self, attr): | |
"""fix for https://github.com/huggingface/huggingface_hub/issues/1603""" | |
try: | |
del self.__dict__[attr] | |
except KeyError: | |
if attr != "_lock": | |
raise AttributeError(attr) | |
def __delattr__(self, attr: str) -> None: | |
"""Fix for https://github.com/huggingface/huggingface_hub/issues/1603""" | |
try: | |
super().__delattr__(attr) | |
except AttributeError: | |
if attr != "_lock": | |
raise |
The documentation is not available anymore as the PR was closed or merged. |
Thanks for taking care of it @NielsRogge. I made an update to your fix and will now merge it. |
Fixes #1603