mirror of https://github.com/scrapy/scrapy.git
Merge pull request #1644 from yarikoptic/master
[MRG+1] BF: robustify _monkeypatches check for twisted - str() name first (Closes #1634)
This commit is contained in:
commit
57f99fc34e
|
|
@ -20,6 +20,6 @@ if sys.version_info[0] == 2:
|
|||
import twisted.persisted.styles # NOQA
|
||||
# Remove only entries with twisted serializers for non-twisted types.
|
||||
for k, v in frozenset(copyreg.dispatch_table.items()):
|
||||
if not getattr(k, '__module__', '').startswith('twisted') \
|
||||
and getattr(v, '__module__', '').startswith('twisted'):
|
||||
if not str(getattr(k, '__module__', '')).startswith('twisted') \
|
||||
and str(getattr(v, '__module__', '')).startswith('twisted'):
|
||||
copyreg.dispatch_table.pop(k)
|
||||
|
|
|
|||
Loading…
Reference in New Issue