Author: Richard Plangger <[email protected]>
Branch: strbuf-as-buffer
Changeset: r89329:fbcff82b11bb
Date: 2017-01-03 10:26 +0100
http://bitbucket.org/pypy/pypy/changeset/fbcff82b11bb/
Log: kill invalid_input_buffer_type and simplify it to
space.isinstance_w(w_x, space.w_unicode)
diff --git a/pypy/module/_cffi_backend/func.py
b/pypy/module/_cffi_backend/func.py
--- a/pypy/module/_cffi_backend/func.py
+++ b/pypy/module/_cffi_backend/func.py
@@ -135,13 +135,8 @@
#
return _from_buffer(space, w_ctype, w_x)
-def invalid_input_buffer_type(space, w_x):
+def _from_buffer(space, w_ctype, w_x):
if space.isinstance_w(w_x, space.w_unicode):
- return True
- return False
-
-def _from_buffer(space, w_ctype, w_x):
- if invalid_input_buffer_type(space, w_x):
raise oefmt(space.w_TypeError,
"from_buffer() cannot return the address a unicode")
buf = _fetch_as_read_buffer(space, w_x)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit