parameters: (self)
docstring: Closes the stream.
docstring_summary: Closes the stream.
docstring_tokens: Closes the stream .
function: def close(self):
          """
          Closes the stream.
          """
          self.acquire()
          try:
              try:
                  if self.stream:
                      try:
                          self.flush()
                      finally:
                          stream = self.stream
                          self.stream = None
                          if hasattr(stream, "close"):
                              stream.close()
              finally:
                  # Issue #19523: call unconditionally to
                  # prevent a handler leak when delay is set
                  StreamHandler.close(self)
          finally:
              self.release()
function_tokens: def close ( self ) : self . acquire ( ) try : try : if self . stream : try : self . flush ( ) finally : stream = self . stream self . stream = None if hasattr ( stream , "close" ) : stream . close ( ) finally : # Issue #19523: call unconditionally to # prevent a handler leak when delay is set StreamHandler . close ( self ) finally : self . release ( )