MCPcopy
hub / github.com/Gallopsled/pwntools / _local_handler

Class _local_handler

pwnlib/timeout.py:39–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37 self.obj.timeout_change()
38
39class _local_handler(object):
40 def __init__(self, obj, timeout):
41 self.obj = obj
42 self.timeout = timeout
43 def __enter__(self):
44 self.old_timeout = self.obj._timeout
45 self.old_stop = self.obj._stop
46
47 self.obj._stop = 0
48 self.obj._timeout = self.timeout # leverage validation
49 self.obj.timeout_change()
50
51 def __exit__(self, *a):
52 self.obj._timeout = self.old_timeout
53 self.obj._stop = self.old_stop
54 self.obj.timeout_change()
55
56class TimeoutDefault(object):
57 def __repr__(self): return "pwnlib.timeout.Timeout.default"

Callers 1

localMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected