Format: text/x-python
⬇ Download File (1.7 KB)
   1  # encoding: utf-8
   2  """
   3  Global exception classes for IPython.core.
   4  
   5  Authors:
   6  
   7  * Brian Granger
   8  * Fernando Perez
   9  * Min Ragan-Kelley
  10  
  11  Notes
  12  -----
  13  """
  14  
  15  #-----------------------------------------------------------------------------
  16  #  Copyright (C) 2008 The IPython Development Team
  17  #
  18  #  Distributed under the terms of the BSD License.  The full license is in
  19  #  the file COPYING, distributed as part of this software.
  20  #-----------------------------------------------------------------------------
  21  
  22  #-----------------------------------------------------------------------------
  23  # Imports
  24  #-----------------------------------------------------------------------------
  25  
  26  #-----------------------------------------------------------------------------
  27  # Exception classes
  28  #-----------------------------------------------------------------------------
  29  
  30  class IPythonCoreError(Exception):
  31      pass
  32  
  33  
  34  class TryNext(IPythonCoreError):
  35      """Try next hook exception.
  36  
  37      Raise this in your hook function to indicate that the next hook handler
  38      should be used to handle the operation.
  39      """
  40  
  41  class UsageError(IPythonCoreError):
  42      """Error in magic function arguments, etc.
  43  
  44      Something that probably won't warrant a full traceback, but should
  45      nevertheless interrupt a macro / batch file.
  46      """
  47  
  48  class StdinNotImplementedError(IPythonCoreError, NotImplementedError):
  49      """raw_input was requested in a context where it is not supported
  50  
  51      For use in IPython kernels, where only some frontends may support
  52      stdin requests.
  53      """
  54  
  55  class InputRejected(Exception):
  56      """Input rejected by ast transformer.
  57  
  58      Raise this in your NodeTransformer to indicate that InteractiveShell should
  59      not execute the supplied input.
  60      """
  61