Fix the TokenTable iterator implementation#100
Fix the TokenTable iterator implementation#100troygraben wants to merge 1 commit intodell:masterfrom
Conversation
|
Cc @srinivasgowda and @GoPerry |
|
This is actually the cause of issue #86 (which has been closed for some reason). I think a much simpler fix for this could be to turn the |
This change supports PEP 479 by changing the generator to use return instead of raising StopIteration. This fixes the RuntimeError exception being raised with Python 3.7 and newer when the iterator reaches the end of the collection. This could be encountered when calling smbios-token-ctl --dump-tokens
|
@Celelibi |
|
This change fixes the problem for me as well. Please merge :) |
|
Hi, still experiencing this issue. |
The
__iter__function must perform initialization and return the iteratorobject itself. The
__next__function must return the next item or raiseStopIteration when no more elements are available.
This fixes the StopIteration exception being uncaught by the for loop when
the iterator reaches the end of the collection. This could be encountered
when calling
smbios-token-ctl --dump-tokens.