issue #406: log socketpair calls too.

issue260
David Wilson 6 years ago
parent 70c550f50c
commit 6ff1e001da

@ -190,6 +190,19 @@ def log_fd_calls():
traceback.print_stack(limit=3) traceback.print_stack(limit=3)
print print
return rv return rv
os.pipe = pipe
real_socketpair = socket.socketpair
def socketpair(*args):
with l:
rv = real_socketpair(*args)
if mypid == os.getpid():
print
print '--', args, '->', rv
traceback.print_stack(limit=3)
print
return rv
socket.socketpair = socketpair
real_dup2 = os.dup2 real_dup2 = os.dup2
def dup2(*args): def dup2(*args):
@ -200,6 +213,7 @@ def log_fd_calls():
print '--', args print '--', args
traceback.print_stack(limit=3) traceback.print_stack(limit=3)
print print
os.dup2 = dup2
real_dup = os.dup real_dup = os.dup
def dup(*args): def dup(*args):
@ -211,10 +225,7 @@ def log_fd_calls():
traceback.print_stack(limit=3) traceback.print_stack(limit=3)
print print
return rv return rv
os.pipe = pipe
os.dup = dup os.dup = dup
os.dup2 = dup2
class CaptureStreamHandler(logging.StreamHandler): class CaptureStreamHandler(logging.StreamHandler):

Loading…
Cancel
Save