New submission from Alex:

This infinite loop:

def f():
  a=b=0
  while 1:
    if a<b: pass

f()

doesn't respond to a Ctrl-C interrupt. If you modify the loop in various ways, 
like removing the function wrapper, then Ctrl-C works fine. It can be 
interrupted with Ctrl-\. This occurs if the program is run from a file or in 
the interactive interpreter.

Tested on Python 2.7.3 / Linux 3.2.0-64 x86_64, and Python 2.7.6 / Linux 
3.13.0-27.

Reproducible: always
Expected behaviour: Ctrl-C interrupts program
Actual beviour: Ctrl-C prints ^C

----------
components: Interpreter Core
messages: 221550
nosy: apsaras
priority: normal
severity: normal
status: open
title: Ctrl-C doesn't interrupt simple loop
versions: Python 2.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21870>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to