Show More
@@ -418,12 +418,6 def _strip_prompts(prompt_re, initial_re=None, turnoff_re=None): | |||
|
418 | 418 | If any prompt is found on the first two lines, |
|
419 | 419 | prompts will be stripped from the rest of the block. |
|
420 | 420 | """ |
|
421 | def pass_thru(line1): | |
|
422 | "Pass lines through unaltered until the end of the cell" | |
|
423 | line = line1 | |
|
424 | while line is not None: | |
|
425 | line = (yield line) | |
|
426 | ||
|
427 | 421 | if initial_re is None: |
|
428 | 422 | initial_re = prompt_re |
|
429 | 423 | line = '' |
@@ -438,8 +432,8 def _strip_prompts(prompt_re, initial_re=None, turnoff_re=None): | |||
|
438 | 432 | if turnoff_re.match(line): |
|
439 | 433 | # We're in e.g. a cell magic; disable this transformer for |
|
440 | 434 | # the rest of the cell. |
|
441 | yield from pass_thru(line) | |
|
442 |
line = |
|
|
435 | while line is not None: | |
|
436 | line = (yield line) | |
|
443 | 437 | continue |
|
444 | 438 | |
|
445 | 439 | line = (yield out) |
@@ -460,8 +454,8 def _strip_prompts(prompt_re, initial_re=None, turnoff_re=None): | |||
|
460 | 454 | |
|
461 | 455 | else: |
|
462 | 456 | # Prompts not in input - wait for reset |
|
463 | yield from pass_thru(line) | |
|
464 |
line = |
|
|
457 | while line is not None: | |
|
458 | line = (yield line) | |
|
465 | 459 | |
|
466 | 460 | @CoroutineInputTransformer.wrap |
|
467 | 461 | def classic_prompt(): |
General Comments 0
You need to be logged in to leave comments.
Login now