MCPcopy
hub / github.com/django/django / __exit__

Method __exit__

django/db/backends/utils.py:44–51  ·  view source on GitHub ↗
(self, type, value, traceback)

Source from the content-addressed store, hash-verified

42 return self
43
44 def __exit__(self, type, value, traceback):
45 # Close instead of passing through to avoid backend-specific behavior
46 # (#17671). Catch errors liberally because errors in cleanup code
47 # aren't useful.
48 try:
49 self.close()
50 except self.db.Database.Error:
51 pass
52
53 # The following methods cannot be implemented in __getattr__, because the
54 # code must run when the method is invoked, not just when it is accessed.

Callers

nothing calls this directly

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected