[pypy-svn] r30656 - pypy/dist/pypy/module/fcntl
rhymes at codespeak.net
rhymes at codespeak.net
Thu Jul 27 20:55:00 CEST 2006
Author: rhymes
Date: Thu Jul 27 20:54:56 2006
New Revision: 30656
Modified:
pypy/dist/pypy/module/fcntl/interp_fcntl.py
Log:
code is not tested. commented
Modified: pypy/dist/pypy/module/fcntl/interp_fcntl.py
==============================================================================
--- pypy/dist/pypy/module/fcntl/interp_fcntl.py (original)
+++ pypy/dist/pypy/module/fcntl/interp_fcntl.py Thu Jul 27 20:54:56 2006
@@ -274,33 +274,28 @@
space.wrap(_get_error_msg()))
return space.wrap(buf.value)
else:
- try:
- # array.array instances
- arg = space.call_method(w_arg, "tostring")
- buf = create_string_buffer(len(arg))
- except:
- raise OperationError(space.w_TypeError,
+ raise OperationError(space.w_TypeError,
space.wrap("an integer or a buffer required"))
-
- if not mutate_flag:
- if len(arg) > IOCTL_BUFSZ:
- raise OperationError(space.w_ValueError,
- space.wrap("ioctl string arg too long"))
-
- rv = ioctl_str(fd, op, buf)
- if rv < 0:
- raise OperationError(space.w_IOError,
- space.wrap(_get_error_msg()))
-
- if mutate_flag:
- return space.wrap(rv)
- else:
- return space.wrap(buf.value)
-
- # # # AFAIK array.array is the only mutable buffer in Python
- # # try:
- # # buf = create_string_buffer(arg.tostring())
- # # except AttributeError:
- # # buf = create_string_buffer(str(arg))
- #
+ # try:
+ # # array.array instances
+ # arg = space.call_method(w_arg, "tostring")
+ # buf = create_string_buffer(len(arg))
+ # except:
+ # raise OperationError(space.w_TypeError,
+ # space.wrap("an integer or a buffer required"))
+ #
+ # if not mutate_flag:
+ # if len(arg) > IOCTL_BUFSZ:
+ # raise OperationError(space.w_ValueError,
+ # space.wrap("ioctl string arg too long"))
+ #
+ # rv = ioctl_str(fd, op, buf)
+ # if rv < 0:
+ # raise OperationError(space.w_IOError,
+ # space.wrap(_get_error_msg()))
+ #
+ # if mutate_flag:
+ # return space.wrap(rv)
+ # else:
+ # return space.wrap(buf.value)
ioctl.unwrap_spec = [ObjSpace, W_Root, int, W_Root, int]
More information about the Pypy-commit
mailing list