Skip to content
Snippets Groups Projects
  • Bastien Montagne's avatar
    487778f6
    Fix T57660: Export of STL format causes an exception. · 487778f6
    Bastien Montagne authored
    Raising StopIteration was never a good idea to abort a generator
    function, and since 3.6 it's converted to a regular RuntimeError
    exception!
    
    Proper way to do that is just to use return statement (as long as there
    is a yield statement somewhere in the function code, it is a generator,
    and return statement has proper special handling in that case).
    487778f6
    History
    Fix T57660: Export of STL format causes an exception.
    Bastien Montagne authored
    Raising StopIteration was never a good idea to abort a generator
    function, and since 3.6 it's converted to a regular RuntimeError
    exception!
    
    Proper way to do that is just to use return statement (as long as there
    is a yield statement somewhere in the function code, it is a generator,
    and return statement has proper special handling in that case).