MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / __init__

Method __init__

tools/python-3.11.9-amd64/Lib/wave.py:276–287  ·  view source on GitHub ↗
(self, f)

Source from the content-addressed store, hash-verified

274 raise Error('fmt chunk and/or data chunk missing')
275
276 def __init__(self, f):
277 self._i_opened_the_file = None
278 if isinstance(f, str):
279 f = builtins.open(f, 'rb')
280 self._i_opened_the_file = f
281 # else, assume it is an open file object already
282 try:
283 self.initfp(f)
284 except:
285 if self._i_opened_the_file:
286 f.close()
287 raise
288
289 def __del__(self):
290 self.close()

Callers

nothing calls this directly

Calls 3

initfpMethod · 0.95
openMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected