Skip to content

Commit 120b52c

Browse files
committed
os: Use uctypes.bytes_at() instead of ffi module.
1 parent db1b0ef commit 120b52c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

os/os/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import ffi
21
import array
32
import ustruct as struct
43
import errno as errno_
@@ -115,7 +114,8 @@ def ilistdir(path="."):
115114
dirent = readdir_(dir)
116115
if not dirent:
117116
break
118-
dirent = ffi.as_bytearray(dirent, struct.calcsize(dirent_fmt))
117+
import uctypes
118+
dirent = uctypes.bytes_at(dirent, struct.calcsize(dirent_fmt))
119119
dirent = struct.unpack(dirent_fmt, dirent)
120120
dirent = (dirent[-1].split(b'\0', 1)[0], dirent[-2], dirent[0])
121121
yield dirent

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy