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:
Elias Dorneles 2016-01-13 08:59:48 -02:00
commit 57f99fc34e
1 changed files with 2 additions and 2 deletions

View File

@ -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)