Skip to content

Commit f2f7c84

Browse files
committed
cat: Fix file opening
1 parent fe96e5a commit f2f7c84

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

userland/utilities/cat.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,11 @@ def python_userland_cat(opts, args):
153153
if name == "-":
154154
generators.append(core.readlines_stdin_raw())
155155
else:
156-
io = core.safe_open(name, "rb")
157-
if io:
158-
generators.append(io)
159-
else:
156+
try:
157+
generators.append(open(name, "rb"))
158+
except OSError as e:
160159
failed = True
160+
core.perror(e)
161161

162162
try:
163163
cat_io(opts, itertools.chain(*generators))

0 commit comments

Comments
 (0)