class_docstr: This class is *almost* compatible with concurrent.futures.Future.
  
  Differences:
  
  - This class is not thread-safe.
  
  - result() and exception() do not take a timeout argument and
    raise an exception when the future isn't done yet.
  
  - Callbacks registered with add_done_callback() are always called
    via the event loop's call_soon().
  
  - This class is not compatible with the wait() and as_completed()
    methods in the concurrent.futures package.
  
  (In Python 3.4 or later we may be able to unify the implementations.)
class_docstr_tok: ["This","class","is","*","almost","*","compatible","with","concurrent.futures.Future",".","Differences",":","-","This","class","is","not","thread-safe",".","-","result","(",")","and","exception","(",")","do","not","take","a","timeout","argument","and","raise","an","exception","when","the","future","is","n't","done","yet",".","-","Callbacks","registered","with","add_done_callback","(",")","are","always","called","via","the","event","loop","'s","call_soon","(",")",".","-","This","class","is","not","compatible","with","the","wait","(",")","and","as_completed","(",")","methods","in","the","concurrent.futures","package",".","(","In","Python","3.4","or","later","we","may","be","able","to","unify","the","implementations",".",")"]
docstr: Create the CancelledError to raise if the Future is cancelled.
  
  This should only be called once when handling a cancellation since
  it erases the saved context exception value.
docstr_tok: ["Create","the","CancelledError","to","raise","if","the","Future","is","cancelled",".","This","should","only","be","called","once","when","handling","a","cancellation","since","it","erases","the","saved","context","exception","value","."]
code: def _make_cancelled_error(self):
      """Create the CancelledError to raise if the Future is cancelled.
  
      This should only be called once when handling a cancellation since
      it erases the saved context exception value.
      """
      if self._cancelled_exc is not None:
          exc = self._cancelled_exc
          self._cancelled_exc = None
          return exc
  
      if self._cancel_message is None:
          exc = exceptions.CancelledError()
      else:
          exc = exceptions.CancelledError(self._cancel_message)
      return exc
  
imports: import concurrent.futures
  import contextvars
  import logging
  import sys
  from types import GenericAlias
  from .None import base_futures
  from .None import events
  from .None import exceptions
  from .None import format_helpers
label_desc: Use image node_id 7 for calling the Future obj's underlying member method code with example usage: obj._make_cancelled_error() and returns: exc, exc