MCPcopy
hub / github.com/rocky/python-uncompyle6 / _get_outstream

Function _get_outstream

uncompyle6/main.py:44–56  ·  view source on GitHub ↗

Return an opened output file descriptor for ``outfile``.

(outfile: str)

Source from the content-addressed store, hash-verified

42
43
44def _get_outstream(outfile: str) -> Any:
45 """
46 Return an opened output file descriptor for ``outfile``.
47 """
48 dir_name = osp.dirname(outfile)
49 failed_file = outfile + "_failed"
50 if osp.exists(failed_file):
51 os.remove(failed_file)
52 try:
53 os.makedirs(dir_name)
54 except OSError:
55 pass
56 return open(outfile, mode="w", encoding="utf-8")
57
58
59def syntax_check(filename: str) -> bool:

Callers 2

decompileFunction · 0.85
mainFunction · 0.85

Calls 2

openFunction · 0.85
removeMethod · 0.45

Tested by

no test coverage detected