aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2020-12-28 09:39:40 +0200
committerMatti Picus <matti.picus@gmail.com>2020-12-28 09:39:40 +0200
commit4a8db00353d2e0c4372e3255a49a0784021126b2 (patch)
tree0cb35dd5ae240f37113b9014c5583cfb00c20b3f /lib_pypy/msvcrt.py
parentfix test, since importing re no longer imports types (via copy_reg) (diff)
downloadpypy-4a8db00353d2e0c4372e3255a49a0784021126b2.tar.gz
pypy-4a8db00353d2e0c4372e3255a49a0784021126b2.tar.bz2
pypy-4a8db00353d2e0c4372e3255a49a0784021126b2.zip
wrap mavcrt.get_osfhandle with FdValidator (removed in the FdValidator refactoring)
Diffstat (limited to 'lib_pypy/msvcrt.py')
-rw-r--r--lib_pypy/msvcrt.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/lib_pypy/msvcrt.py b/lib_pypy/msvcrt.py
index 8d4b97a532..67c142745a 100644
--- a/lib_pypy/msvcrt.py
+++ b/lib_pypy/msvcrt.py
@@ -19,9 +19,7 @@ _lib = _ffi.dlopen(_rawffi.get_libc().name)
import errno
-try: from __pypy__ import builtinify, validate_fd
-except ImportError: builtinify = validate_fd = lambda f: f
-
+from __pypy__ import builtinify, get_osfhandle as _get_osfhandle
def _ioerr():
e = _ffi.errno
@@ -47,11 +45,7 @@ def get_osfhandle(fd):
Return the file handle for the file descriptor fd. Raises IOError if
fd is not recognized."""
- try:
- validate_fd(fd)
- except OSError as e:
- raise IOError(*e.args)
- result = _lib._get_osfhandle(fd)
+ result = _get_osfhandle(fd)
if result == -1:
_ioerr()
return result