Remove metaclass-related six code

This commit is contained in:
Eugenio Lacuesta 2019-11-03 12:03:02 -03:00
parent e461570f99
commit 7f3cb05d8e
No known key found for this signature in database
GPG Key ID: DA3EF2D0913E9810
2 changed files with 2 additions and 7 deletions

View File

@ -10,8 +10,6 @@ from copy import deepcopy
from pprint import pformat
from warnings import warn
import six
from scrapy.utils.deprecate import ScrapyDeprecationWarning
from scrapy.utils.trackref import object_ref
@ -130,6 +128,5 @@ class DictItem(MutableMapping, BaseItem):
return deepcopy(self)
@six.add_metaclass(ItemMeta)
class Item(DictItem):
class Item(DictItem, metaclass=ItemMeta):
pass

View File

@ -3,8 +3,6 @@ import unittest
from unittest import mock
from warnings import catch_warnings
import six
from scrapy.exceptions import ScrapyDeprecationWarning
from scrapy.item import ABCMeta, DictItem, Field, Item, ItemMeta
@ -302,7 +300,7 @@ class ItemMetaTest(unittest.TestCase):
class ItemMetaClassCellRegression(unittest.TestCase):
def test_item_meta_classcell_regression(self):
class MyItem(six.with_metaclass(ItemMeta, Item)):
class MyItem(Item, metaclass=ItemMeta):
def __init__(self, *args, **kwargs):
# This call to super() trigger the __classcell__ propagation
# requirement. When not done properly raises an error: