[pypy-svn] r69618 - pypy/trunk/pypy/lib
xoraxax at codespeak.net
xoraxax at codespeak.net
Wed Nov 25 00:02:12 CET 2009
Author: xoraxax
Date: Wed Nov 25 00:02:11 2009
New Revision: 69618
Modified:
pypy/trunk/pypy/lib/msvcrt.py
Log:
Correctly raise an import error on platforms without msvcrt support.
Modified: pypy/trunk/pypy/lib/msvcrt.py
==============================================================================
--- pypy/trunk/pypy/lib/msvcrt.py (original)
+++ pypy/trunk/pypy/lib/msvcrt.py Wed Nov 25 00:02:11 2009
@@ -9,7 +9,11 @@
import ctypes
from ctypes_support import standard_c_lib as _c
-open_osfhandle = _c._open_osfhandle
+try:
+ open_osfhandle = _c._open_osfhandle
+except AttributeError: # we are not on windows
+ raise ImportError
+
open_osfhandle.argtypes = [ctypes.c_int, ctypes.c_int]
open_osfhandle.restype = ctypes.c_int
More information about the Pypy-commit
mailing list