diff --git a/scrapy/xlib/twisted_250_monkeypatches.py b/scrapy/xlib/twisted_250_monkeypatches.py index 1395161c8..56dc93f31 100644 --- a/scrapy/xlib/twisted_250_monkeypatches.py +++ b/scrapy/xlib/twisted_250_monkeypatches.py @@ -41,7 +41,8 @@ def add_missing_blockingCallFromThread(): try: import twisted - if twisted.__version__ < '8.0.0': + from twisted.python.versions import Version + if twisted.version < Version("twisted", 8, 0, 0): add_missing_blockingCallFromThread() except ImportError: pass