MCPcopy
hub / github.com/pallets/werkzeug / close

Method close

src/werkzeug/test.py:649–665  ·  view source on GitHub ↗

Closes all files. If you put real :class:`file` objects into the :attr:`files` dict you can call this method to automatically close them all in one go.

(self)

Source from the content-addressed store, hash-verified

647 pass
648
649 def close(self) -> None:
650 """Closes all files. If you put real :class:`file` objects into the
651 :attr:`files` dict you can call this method to automatically close
652 them all in one go.
653 """
654 if self.closed:
655 return
656 try:
657 files = self.files.values()
658 except AttributeError:
659 files = ()
660 for f in files:
661 try:
662 f.close()
663 except Exception:
664 pass
665 self.closed = True
666
667 def get_environ(self) -> WSGIEnvironment:
668 """Return the built environ.

Callers 8

__del__Method · 0.95
openMethod · 0.95
create_environFunction · 0.95
from_valuesMethod · 0.95
test_file_closingFunction · 0.95
resolve_redirectMethod · 0.45

Calls 1

valuesMethod · 0.45

Tested by

no test coverage detected