equal
deleted
inserted
replaced
13 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more |
13 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more |
14 # details. |
14 # details. |
15 # |
15 # |
16 # You should have received a copy of the GNU Lesser General Public License along |
16 # You should have received a copy of the GNU Lesser General Public License along |
17 # with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
17 # with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
18 from __future__ import print_function |
|
19 |
|
20 import gc, types, weakref |
18 import gc, types, weakref |
21 |
|
22 from six import PY2 |
|
23 |
19 |
24 from cubicweb.schema import CubicWebRelationSchema, CubicWebEntitySchema |
20 from cubicweb.schema import CubicWebRelationSchema, CubicWebEntitySchema |
25 try: |
21 try: |
26 from cubicweb.web.request import _NeedAuthAccessMock |
22 from cubicweb.web.request import _NeedAuthAccessMock |
27 except ImportError: |
23 except ImportError: |
35 listiterator, |
31 listiterator, |
36 property, classmethod, |
32 property, classmethod, |
37 types.ModuleType, types.FunctionType, types.MethodType, |
33 types.ModuleType, types.FunctionType, types.MethodType, |
38 types.MemberDescriptorType, types.GetSetDescriptorType, |
34 types.MemberDescriptorType, types.GetSetDescriptorType, |
39 ) |
35 ) |
40 if PY2: |
|
41 # weakref.WeakKeyDictionary fails isinstance check on Python 3.5. |
|
42 IGNORE_CLASSES += (weakref.WeakKeyDictionary, ) |
|
43 |
36 |
44 if _NeedAuthAccessMock is not None: |
37 if _NeedAuthAccessMock is not None: |
45 IGNORE_CLASSES = IGNORE_CLASSES + (_NeedAuthAccessMock,) |
38 IGNORE_CLASSES = IGNORE_CLASSES + (_NeedAuthAccessMock,) |
46 |
39 |
47 def _get_counted_class(obj, classes): |
40 def _get_counted_class(obj, classes): |