-
Notifications
You must be signed in to change notification settings - Fork 48
Closed
Description
Hi,
MocketSocket doesn't seem to support context manager, so the construct:
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.connect((target.host, target.port, 0, 0))
s.sendall(something)
data = s.recv(4096)
throws an AttributeError:
Traceback (most recent call last):
File "/home/scanner/scanner.py", line 32, in scan
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
AttributeError: __enter__
Is it by design? Any way to work around it (besides rewriting the original code that uses with socket.socket )?
Thanks!
Metadata
Metadata
Assignees
Labels
No labels