MCPcopy Create free account
hub / github.com/XingangPan/DragGAN / close

Method close

dnnlib/util.py:100–112  ·  view source on GitHub ↗

Flush, close possible files, and remove stdout/stderr mirroring.

(self)

Source from the content-addressed store, hash-verified

98 self.stdout.flush()
99
100 def close(self) -> None:
101 """Flush, close possible files, and remove stdout/stderr mirroring."""
102 self.flush()
103
104 # if using multiple loggers, prevent closing in wrong order
105 if sys.stdout is self:
106 sys.stdout = self.stdout
107 if sys.stderr is self:
108 sys.stderr = self.stderr
109
110 if self.file is not None:
111 self.file.close()
112 self.file = None
113
114
115# Cache directories

Callers 1

__exit__Method · 0.95

Calls 1

flushMethod · 0.95

Tested by

no test coverage detected