Skip to content

Conversation

lostmsu
Copy link
Member

@lostmsu lostmsu commented Jul 7, 2021

port of 8e1d4db

What does this implement/fix? Explain your changes.

Prevents crash on converting sequences to arrays when sequence lacks __len__.

Sequence types might return error from PySequence_Size (like sequences provided by generators or types implemented in C, that lack sq_length slot or make it throw). This change adds handling for this case.

@lostmsu lostmsu added the mini label Jul 7, 2021
@lostmsu lostmsu force-pushed the Mini/NoCrashWhenSequenceLengthUndefined branch from f02f565 to 41474f1 Compare July 7, 2021 00:44
@lostmsu lostmsu force-pushed the Mini/NoCrashWhenSequenceLengthUndefined branch from 41474f1 to b52823b Compare July 7, 2021 00:46
@filmor filmor merged commit 2ac5f4e into pythonnet:master Jul 7, 2021
@lostmsu lostmsu deleted the Mini/NoCrashWhenSequenceLengthUndefined branch July 7, 2021 23:40
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