class_docstr: A context manager that will catch certain exceptions and provide an
  indication they occurred.
  
  >>> with ExceptionTrap() as trap:
  ...     raise Exception()
  >>> bool(trap)
  True
  
  >>> with ExceptionTrap() as trap:
  ...     pass
  >>> bool(trap)
  False
  
  >>> with ExceptionTrap(ValueError) as trap:
  ...     raise ValueError("1 + 1 is not 3")
  >>> bool(trap)
  True
  >>> trap.value
  ValueError('1 + 1 is not 3')
  >>> trap.tb
  <traceback object at ...>
  
  >>> with ExceptionTrap(ValueError) as trap:
  ...     raise Exception()
  Traceback (most recent call last):
  ...
  Exception
  
  >>> bool(trap)
  False
class_docstr_tok: ["A","context","manager","that","will","catch","certain","exceptions","and","provide","an","indication","they","occurred",".",">",">",">","with","ExceptionTrap","(",")","as","trap",":","...","raise","Exception","(",")",">",">",">","bool","(","trap",")","True",">",">",">","with","ExceptionTrap","(",")","as","trap",":","...","pass",">",">",">","bool","(","trap",")","False",">",">",">","with","ExceptionTrap","(","ValueError",")","as","trap",":","...","raise","ValueError","(","``","1","+","1","is","not","3","''",")",">",">",">","bool","(","trap",")","True",">",">",">","trap.value","ValueError","(","'","1","+","1","is","not","3","'",")",">",">",">","trap.tb","<","traceback","object","at","...",">",">",">",">","with","ExceptionTrap","(","ValueError",")","as","trap",":","...","raise","Exception","(",")","Traceback","(","most","recent","call","last",")",":","...","Exception",">",">",">","bool","(","trap",")","False"]
docstr: Wrap func and replace the result with the truth
  value of the trap (True if an exception occurred).
  
  First, give the decorator an alias to support Python 3.8
  Syntax.
  
  >>> raises = ExceptionTrap(ValueError).raises
  
  Now decorate a function that always fails.
  
  >>> @raises
  ... def fail():
  ...     raise ValueError('failed')
  >>> fail()
  True
docstr_tok: ["Wrap","func","and","replace","the","result","with","the","truth","value","of","the","trap","(","True","if","an","exception","occurred",")",".","First",",","give","the","decorator","an","alias","to","support","Python","3.8","Syntax",".",">",">",">","raises","=","ExceptionTrap","(","ValueError",")",".raises","Now","decorate","a","function","that","always","fails",".",">",">",">","@","raises","...","def","fail","(",")",":","...","raise","ValueError","(","'failed","'",")",">",">",">","fail","(",")","True"]
code: def raises(self, func, *, _test=bool):
      """
      Wrap func and replace the result with the truth
      value of the trap (True if an exception occurred).
  
      First, give the decorator an alias to support Python 3.8
      Syntax.
  
      >>> raises = ExceptionTrap(ValueError).raises
  
      Now decorate a function that always fails.
  
      >>> @raises
      ... def fail():
      ...     raise ValueError('failed')
      >>> fail()
      True
      """
  
      @functools.wraps(func)
      def wrapper(*args, **kwargs):
          with ExceptionTrap(self.exceptions) as trap:
              func(*args, **kwargs)
          return _test(trap)
  
      return wrapper
  
imports: import os
  import subprocess
  import contextlib
  import functools
  import tempfile
  import shutil
  import operator
  import warnings
label_desc: Use image node_id 8 for calling the ExceptionTrap obj's underlying member method code with example usage: obj.raises(func) and returns: wrapper, _test