MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / opened_w_error

Function opened_w_error

utils/install.py:101–111  ·  view source on GitHub ↗
(filename, mode="r")

Source from the content-addressed store, hash-verified

99
100@contextmanager
101def opened_w_error(filename, mode="r"):
102 try:
103 f = open(filename, mode)
104 except IOError as err:
105 logging.critical("Error opening file: %s error: %s", filename, err.strerror)
106 yield None
107 else:
108 try:
109 yield f
110 finally:
111 f.close()
112
113
114def _is_tarxz(filename):

Callers 4

extract_archiveFunction · 0.85
set_envFunction · 0.85
shell_configureFunction · 0.85

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected