(conn)
r"""
	Redirects the other party's ``stdin``, ``stdout`` and ``stderr`` to 
	those of the local party, so remote IO will occur locally.

	Example usage::
	
		with redirected_stdio(conn):
			conn.modules.sys.stdout.write("hello\n")   # will be printed locally
r"""
	Redirects the other party's ``stdin``, ``stdout`` and ``stderr`` to 
	those of the local party, so remote IO will occur locally.
r Redirects the other party s stdin stdout and stderr to those of the local party so remote IO will occur locally .
def redirected_stdio(conn):
	r"""
	Redirects the other party's ``stdin``, ``stdout`` and ``stderr`` to 
	those of the local party, so remote IO will occur locally.

	Example usage::
	
		with redirected_stdio(conn):
			conn.modules.sys.stdout.write("hello\n")   # will be printed locally
	
	"""
	orig_stdin = conn.modules.sys.stdin
	orig_stdout = conn.modules.sys.stdout
	orig_stderr = conn.modules.sys.stderr
	try:
		conn.modules.sys.stdin =restricted(sys.stdin, ["softspace", "write", "readline", "encoding", "close"])
		conn.modules.sys.stdout = restricted(sys.stdout, ["softspace", "write", "readline", "encoding", "close", "flush"])
		conn.modules.sys.stderr = restricted(sys.stderr, ["softspace", "write", "readline", "encoding", "close", "flush"])
		yield
	finally:
		conn.modules.sys.stdin = orig_stdin
		conn.modules.sys.stdout = orig_stdout
		conn.modules.sys.stderr = orig_stderr
def redirected_stdio ( conn ) : orig_stdin = conn . modules . sys . stdin orig_stdout = conn . modules . sys . stdout orig_stderr = conn . modules . sys . stderr try : conn . modules . sys . stdin = restricted ( sys . stdin , [ "softspace" , "write" , "readline" , "encoding" , "close" ] ) conn . modules . sys . stdout = restricted ( sys . stdout , [ "softspace" , "write" , "readline" , "encoding" , "close" , "flush" ] ) conn . modules . sys . stderr = restricted ( sys . stderr , [ "softspace" , "write" , "readline" , "encoding" , "close" , "flush" ] ) yield finally : conn . modules . sys . stdin = orig_stdin conn . modules . sys . stdout = orig_stdout conn . modules . sys . stderr = orig_stderr