Skip to content

Kernel died on recursive iterator #635

Open

Description

@eendebakpt

The following minimal example results in a ValueError when executed directly

from itertools import pairwise

def g():
    yield next(it)

it = pairwise(g())
next(it)

(e.g. run python example.py, which example.py containing the code above)

When running the same code in a qtconsole (or a Spyder cell) I get

The kernel died, restarting...

(or in spyder)

Exception ignored in: <generator object g at 0x000001F52B734940>
Traceback (most recent call last):
  File "C:\Users\eendebakpt\AppData\Local\Temp\ipykernel_7984\1968913502.py", line 4, in g
ValueError: generator already executing

The kernel died, restarting...

The code is obviously not very sensible to run, but still the kernel should not restart.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions