Author: Armin Rigo <[email protected]>
Branch:
Changeset: r88225:336f8717b768
Date: 2016-11-08 19:15 +0100
http://bitbucket.org/pypy/pypy/changeset/336f8717b768/
Log: Win32: remove rposix.fdlistdir()
diff --git a/rpython/rlib/rposix.py b/rpython/rlib/rposix.py
--- a/rpython/rlib/rposix.py
+++ b/rpython/rlib/rposix.py
@@ -679,21 +679,22 @@
raise OSError(error, "readdir failed")
return result
-def fdlistdir(dirfd):
- """
- Like listdir(), except that the directory is specified as an open
- file descriptor.
+if not _WIN32:
+ def fdlistdir(dirfd):
+ """
+ Like listdir(), except that the directory is specified as an open
+ file descriptor.
- Note: fdlistdir() closes the file descriptor. To emulate the
- Python 3.x 'os.opendir(dirfd)', you must first duplicate the
- file descriptor.
- """
- dirp = c_fdopendir(dirfd)
- if not dirp:
- error = get_saved_errno()
- c_close(dirfd)
- raise OSError(error, "opendir failed")
- return _listdir(dirp, rewind=True)
+ Note: fdlistdir() closes the file descriptor. To emulate the
+ Python 3.x 'os.opendir(dirfd)', you must first duplicate the
+ file descriptor.
+ """
+ dirp = c_fdopendir(dirfd)
+ if not dirp:
+ error = get_saved_errno()
+ c_close(dirfd)
+ raise OSError(error, "opendir failed")
+ return _listdir(dirp, rewind=True)
@replace_os_function('listdir')
@specialize.argtype(0)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit