File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3609,9 +3609,7 @@ static PyTypeObject CDataGCP_Type = {
36093609 0 , /* inherited */ /* tp_setattro */
36103610 0 , /* tp_as_buffer */
36113611 Py_TPFLAGS_DEFAULT /* tp_flags */
3612- #ifdef Py_TPFLAGS_HAVE_FINALIZE
36133612 | Py_TPFLAGS_HAVE_FINALIZE
3614- #endif
36153613 | Py_TPFLAGS_HAVE_GC ,
36163614 "This is an internal subtype of _CDataBase for performance only on "
36173615 "CPython. Check with isinstance(x, ffi.CData)." , /* tp_doc */
@@ -3625,7 +3623,6 @@ static PyTypeObject CDataGCP_Type = {
36253623 0 , /* tp_members */
36263624 0 , /* tp_getset */
36273625 & CData_Type , /* tp_base */
3628- #ifdef Py_TPFLAGS_HAVE_FINALIZE /* CPython >= 3.4 */
36293626 0 , /* tp_dict */
36303627 0 , /* tp_descr_get */
36313628 0 , /* tp_descr_set */
@@ -3643,7 +3640,6 @@ static PyTypeObject CDataGCP_Type = {
36433640 0 , /* tp_del */
36443641 0 , /* version_tag */
36453642 (destructor )cdatagcp_finalize , /* tp_finalize */
3646- #endif
36473643};
36483644
36493645/************************************************************/
Original file line number Diff line number Diff line change @@ -30,8 +30,7 @@ def __init__(self, backend=None):
3030 select a non-default backend, mostly for tests.
3131 """
3232 if backend is None :
33- # You need PyPy (>= 2.0 beta), or a CPython (>= 2.6) with
34- # _cffi_backend.so compiled.
33+ # You need PyPy or a CPython with _cffi_backend.so compiled.
3534 import _cffi_backend as backend
3635 from . import __version__
3736 if backend .__version__ != __version__ :
@@ -603,10 +602,7 @@ def ensure(key, value):
603602 if hasattr (sys , 'gettotalrefcount' ):
604603 template += '_d'
605604 else :
606- try :
607- import sysconfig
608- except ImportError : # 2.6
609- from cffi ._shimmed_dist_utils import sysconfig
605+ import sysconfig
610606 template = "python%d.%d"
611607 if sysconfig .get_config_var ('DEBUG_EXT' ):
612608 template += sysconfig .get_config_var ('DEBUG_EXT' )
Original file line number Diff line number Diff line change 22import sys
33import sysconfig
44
5- try :
6- basestring
7- except NameError :
8- # Python 3.x
9- basestring = str
10-
115def error (msg ):
126 from cffi ._shimmed_dist_utils import DistutilsSetupError
137 raise DistutilsSetupError (msg )
@@ -29,7 +23,7 @@ def execfile(filename, glob):
2923def add_cffi_module (dist , mod_spec ):
3024 from cffi .api import FFI
3125
32- if not isinstance (mod_spec , basestring ):
26+ if not isinstance (mod_spec , str ):
3327 error ("argument to 'cffi_modules=...' must be a str or a list of str,"
3428 " not %r" % (type (mod_spec ).__name__ ,))
3529 mod_spec = str (mod_spec )
@@ -219,7 +213,7 @@ def run(self):
219213
220214def cffi_modules (dist , attr , value ):
221215 assert attr == 'cffi_modules'
222- if isinstance (value , basestring ):
216+ if isinstance (value , str ):
223217 value = [value ]
224218
225219 for cffi_module in value :
You can’t perform that action at this time.
0 commit comments