fix: resolve gevent LoopExit and AssertionError crashes

monkey.patch_all(thread=False) still patches the queue module, which
replaces queue.SimpleQueue used internally by ThreadPoolExecutor with
a gevent queue. Worker threads in ThreadPoolExecutor have no gevent
hub, causing LoopExit ("This operation would block forever") and
AssertionError ("Can only use Waiter.switch method from the Hub
greenlet") exceptions during scanning.

Adding queue=False preserves the standard queue for ThreadPoolExecutor
while keeping gevent's socket/ssl patching for cooperative I/O.
This commit is contained in:
fff122
2026-08-19 12:41:03 +08:00
parent 166cd29f32
commit 0c4953f4e3
+1 -1
View File
@@ -6,7 +6,7 @@
#=================== 需放置于最开头 ====================
import warnings; warnings.filterwarnings("ignore")
from gevent import monkey; monkey.patch_all(thread=False)
from gevent import monkey; monkey.patch_all(thread=False, queue=False)
#======================================================
import os