##// END OF EJS Templates
Merge branch 'paste-errmsg'
Thomas Kluyver -
r5369:6c203584 merge
parent child Browse files
Show More
@@ -138,7 +138,7 b' class CommandChainDispatcher:'
138 args = exc.args
138 args = exc.args
139 kw = exc.kwargs
139 kw = exc.kwargs
140 # if no function will accept it, raise TryNext up to the caller
140 # if no function will accept it, raise TryNext up to the caller
141 raise TryNext
141 raise TryNext(*args, **kw)
142
142
143 def __str__(self):
143 def __str__(self):
144 return str(self.chain)
144 return str(self.chain)
@@ -34,7 +34,7 b' from IPython.testing.skipdoctest import skip_doctest'
34 from IPython.utils import py3compat
34 from IPython.utils import py3compat
35 from IPython.utils.terminal import toggle_set_term_title, set_term_title
35 from IPython.utils.terminal import toggle_set_term_title, set_term_title
36 from IPython.utils.process import abbrev_cwd
36 from IPython.utils.process import abbrev_cwd
37 from IPython.utils.warn import warn
37 from IPython.utils.warn import warn, error
38 from IPython.utils.text import num_ini_spaces
38 from IPython.utils.text import num_ini_spaces
39 from IPython.utils.traitlets import Integer, CBool, Unicode
39 from IPython.utils.traitlets import Integer, CBool, Unicode
40
40
@@ -611,9 +611,16 b' class TerminalInteractiveShell(InteractiveShell):'
611 if opts.has_key('r'):
611 if opts.has_key('r'):
612 self._rerun_pasted()
612 self._rerun_pasted()
613 return
613 return
614
614 try:
615 text = self.shell.hooks.clipboard_get()
615 text = self.shell.hooks.clipboard_get()
616 block = self._strip_pasted_lines_for_code(text.splitlines())
616 block = self._strip_pasted_lines_for_code(text.splitlines())
617 except TryNext as clipboard_exc:
618 message = getattr(clipboard_exc, 'args')
619 if message:
620 error(message[0])
621 else:
622 error('Could not get text from the clipboard.')
623 return
617
624
618 # By default, echo back to terminal unless quiet mode is requested
625 # By default, echo back to terminal unless quiet mode is requested
619 if not opts.has_key('q'):
626 if not opts.has_key('q'):
General Comments 0
You need to be logged in to leave comments. Login now