[pypy-commit] pypy py3.5: Replace @api_decl(..., cts) with @cts.decl(...)
rlamy
pypy.commits at gmail.com
Mon Jan 30 11:19:24 EST 2017
Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: py3.5
Changeset: r89843:3bda7ec5d342
Date: 2017-01-30 16:18 +0000
http://bitbucket.org/pypy/pypy/changeset/3bda7ec5d342/
Log: Replace @api_decl(..., cts) with @cts.decl(...)
diff --git a/pypy/module/cpyext/import_.py b/pypy/module/cpyext/import_.py
--- a/pypy/module/cpyext/import_.py
+++ b/pypy/module/cpyext/import_.py
@@ -1,6 +1,5 @@
from pypy.module.cpyext.api import (
- cpython_api, PyObject, CONST_STRING, CANNOT_FAIL,
- cts, api_decl)
+ cpython_api, PyObject, CONST_STRING, CANNOT_FAIL, cts)
from rpython.rtyper.lltypesystem import lltype, rffi
from pypy.interpreter.error import OperationError, oefmt
from pypy.interpreter.module import Module
@@ -51,10 +50,10 @@
return PyImport_Import(space, space.wrap(rffi.charp2str(name)))
- at api_decl(
+ at cts.decl(
'''PyObject* PyImport_ImportModuleLevelObject(
PyObject *name, PyObject *given_globals, PyObject *locals,
- PyObject *given_fromlist, int level)''', cts)
+ PyObject *given_fromlist, int level)''')
def PyImport_ImportModuleLevelObject(space, w_name, w_glob, w_loc, w_fromlist, level):
level = rffi.cast(lltype.Signed, level)
if w_glob is None:
diff --git a/pypy/module/cpyext/object.py b/pypy/module/cpyext/object.py
--- a/pypy/module/cpyext/object.py
+++ b/pypy/module/cpyext/object.py
@@ -1,7 +1,7 @@
from rpython.rtyper.lltypesystem import rffi, lltype
from pypy.module.cpyext.api import (
cpython_api, generic_cpy_call, CANNOT_FAIL, Py_ssize_t, Py_ssize_tP,
- PyVarObject, Py_buffer, size_t, slot_function, api_decl, cts,
+ PyVarObject, Py_buffer, size_t, slot_function, cts,
PyBUF_FORMAT, PyBUF_ND, PyBUF_STRIDES,
Py_TPFLAGS_HEAPTYPE, Py_LT, Py_LE, Py_EQ, Py_NE, Py_GT,
Py_GE, CONST_STRING, CONST_STRINGP, FILEP, fwrite)
@@ -248,7 +248,7 @@
return space.wrap("<NULL>")
return space.str(w_obj)
- at api_decl("PyObject * PyObject_Bytes(PyObject *v)", cts)
+ at cts.decl("PyObject * PyObject_Bytes(PyObject *v)")
def PyObject_Bytes(space, w_obj):
if w_obj is None:
return space.newbytes("<NULL>")
diff --git a/pypy/module/cpyext/unicodeobject.py b/pypy/module/cpyext/unicodeobject.py
--- a/pypy/module/cpyext/unicodeobject.py
+++ b/pypy/module/cpyext/unicodeobject.py
@@ -2,7 +2,7 @@
from rpython.rtyper.lltypesystem import rffi, lltype
from pypy.module.unicodedata import unicodedb
from pypy.module.cpyext.api import (
- CANNOT_FAIL, Py_ssize_t, build_type_checkers, cpython_api, api_decl,
+ CANNOT_FAIL, Py_ssize_t, build_type_checkers, cpython_api,
bootstrap_function, CONST_STRING,
CONST_WSTRING, Py_CLEANUP_SUPPORTED, slot_function, cts, parse_dir)
from pypy.module.cpyext.pyerrors import PyErr_BadArgument
@@ -234,7 +234,7 @@
raise oefmt(space.w_TypeError, "expected unicode object")
return PyUnicode_AS_UNICODE(space, rffi.cast(rffi.VOIDP, ref))
- at api_decl("char * PyUnicode_AsUTF8(PyObject *unicode)", cts)
+ at cts.decl("char * PyUnicode_AsUTF8(PyObject *unicode)")
def PyUnicode_AsUTF8(space, ref):
ref_unicode = rffi.cast(PyUnicodeObject, ref)
if not ref_unicode.c_utf8buffer:
More information about the pypy-commit
mailing list