Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixing issue #56

  • Loading branch information...
commit 609d83efd325a6d9b89cc6baa182134cb111e7fa 1 parent ef03f85
Daniel Velkov authored
11 IPython/core/
@@ -3187,11 +3187,14 @@ def _get_pasted_lines(self, sentinel):
from IPython.core import interactiveshell
print "Pasting code; enter '%s' alone on the line to stop." % sentinel
while True:
- l =':')
- if l == sentinel:
+ try:
+ l =':')
+ if l == sentinel:
+ return
+ else:
+ yield l
+ except EOFError:
- else:
- yield l
def _strip_pasted_lines_for_code(self, raw_lines):
""" Strip non-code parts of a sequence of lines to return a block of
2  IPython/frontend/terminal/
@@ -487,7 +487,7 @@ def magic_autoindent(self, parameter_s = ''):
def magic_cpaste(self, parameter_s=''):
"""Paste & execute a pre-formatted code block from clipboard.
- You must terminate the block with '--' (two minus-signs) alone on the
+ You must terminate the block with '--' (two minus-signs) or Ctrl-D alone on the
line. You can also provide your own sentinel with '%paste -s %%' ('%%'
is the new sentinel for this operation)
Please sign in to comment.
Something went wrong with that request. Please try again.