Skip to content
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

Fixed #25657 -- Ignored TypeErrors when destroying geometry objects #5778

Merged
merged 1 commit into from
Dec 8, 2015

Conversation

claudep
Copy link
Member

@claudep claudep commented Dec 6, 2015

Due to randomness of garbage collection with geometry objects, it's
easier to simply ignore TypeErrors generally raised when parts of
objects are already garbage-collected.

@@ -87,8 +87,10 @@ def __init__(self, ds_input, ds_driver=False, write=False, encoding='utf-8'):

def __del__(self):
"Destroys this DataStructure object."
if self._ptr and capi:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and capi was added in 8f334e5 to prevent AttributeError, was it unneeded?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, seems we also have to catch AttributeError.

@sir-sigurd
Copy link
Member

Does this fix make this note unneeded?

@claudep
Copy link
Member Author

claudep commented Dec 6, 2015

Hopefully yes. I'm not completely sure we solved all such cases.

@timgraham
Copy link
Member

Add code comments to make the purpose clear for future readers?

Due to randomness of garbage collection with geometry objects, it's
easier to simply ignore AttributeError/TypeError generally raised when
parts of objects are already garbage-collected.
Thanks Sergey Fedoseev and Tim Graham for reviewing the patch.
@claudep
Copy link
Member Author

claudep commented Dec 8, 2015

Something like that?

@timgraham
Copy link
Member

sure, thanks!

@claudep claudep merged commit cd40d9e into django:master Dec 8, 2015
@claudep claudep deleted the 25657 branch December 8, 2015 21:20
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.

3 participants