[pypy-svn] r43985 - in pypy/branch/kill-ctypes/pypy/module/fcntl: . test

fijal at codespeak.net fijal at codespeak.net
Fri Jun 1 23:34:05 CEST 2007


Author: fijal
Date: Fri Jun  1 23:34:04 2007
New Revision: 43985

Modified:
   pypy/branch/kill-ctypes/pypy/module/fcntl/interp_fcntl.py
   pypy/branch/kill-ctypes/pypy/module/fcntl/test/test_fcntl.py
Log:
Minor tweak to allow ioctl to return 0-containing strings


Modified: pypy/branch/kill-ctypes/pypy/module/fcntl/interp_fcntl.py
==============================================================================
--- pypy/branch/kill-ctypes/pypy/module/fcntl/interp_fcntl.py	(original)
+++ pypy/branch/kill-ctypes/pypy/module/fcntl/interp_fcntl.py	Fri Jun  1 23:34:04 2007
@@ -246,7 +246,6 @@
     If the arg given is an integer or if none is specified, the result value
     is an integer corresponding to the return value of the ioctl call in the
     C code."""
-
     fd = _conv_descriptor(space, w_fd)
     # Python turns number > sys.maxint into long, we need the signed C value
     op = c_int(op).value
@@ -272,7 +271,7 @@
         if rv < 0:
             raise OperationError(space.w_IOError,
                 space.wrap(_get_error_msg()))
-        return space.wrap(buf.value)
+        return space.wrap(buf.raw)
     else:
         raise OperationError(space.w_TypeError,
                 space.wrap("an integer or a buffer required"))

Modified: pypy/branch/kill-ctypes/pypy/module/fcntl/test/test_fcntl.py
==============================================================================
--- pypy/branch/kill-ctypes/pypy/module/fcntl/test/test_fcntl.py	(original)
+++ pypy/branch/kill-ctypes/pypy/module/fcntl/test/test_fcntl.py	Fri Jun  1 23:34:04 2007
@@ -162,7 +162,7 @@
         raises(TypeError, fcntl.ioctl, f, "foo")
         raises(TypeError, fcntl.ioctl, f, TIOCGPGRP, float(0))
         raises(TypeError, fcntl.ioctl, f, TIOCGPGRP, 1, "foo")
-        
+
         # buf = array.array('h', [0])
         # fcntl.ioctl(0, TIOCGPGRP, buf, True)
         # buf = array.array('c', "a"*1025)



More information about the Pypy-commit mailing list