Skip to content

Commit 496b318

Browse files
committed
Remove now-redundant access check.
1 parent be34f33 commit 496b318

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

yowasp_runtime/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,12 @@ def run_wasm(__package__, wasm_filename, *, resources=[], argv):
7272
else:
7373
# can't do this for files, but no one's going to use yowasp on files in / anyway
7474
for path in os.listdir("/"):
75-
if os.path.isdir("/" + path) and os.access("/" + path, os.R_OK):
76-
wasi_cfg.preopen_dir("/" + path, "/" + path)
75+
if os.path.isdir("/" + path):
76+
try:
77+
wasi_cfg.preopen_dir("/" + path, "/" + path)
78+
except wasmtime.WasmtimeError:
79+
# root subdirectory present, but not accessible (permission issue?); ignore
80+
continue
7781

7882
# preopens for relative paths
7983
wasi_cfg.preopen_dir(".", ".")

0 commit comments

Comments
 (0)