Skip to content

Check for cookie attribute before trying to delete it #244

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

Merged
merged 2 commits into from
May 17, 2021

Conversation

jspricke
Copy link
Contributor

No description provided.

jspricke added 2 commits May 16, 2021 10:36
__del__ is called regardless of whether __init__ passed, so the cookie
attribute may not exits. This can be seen with:

python3 -c "import magic; magic.Magic(foo=None)"

Also discussed in ahupp#222 (comment)
@ahupp
Copy link
Owner

ahupp commented May 17, 2021

Ah, I should have read that issue more closely. Thanks for the patch!

@ahupp ahupp merged commit e6d7ee0 into ahupp:master May 17, 2021
@jspricke jspricke deleted the fix_del_cookie branch May 17, 2021 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants