Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 186876 | Differences between
and this patch

Collapse All | Expand All

(-)pym/portage.py (-3 / +10 lines)
Lines 2332-2337 Link Here
2332
	master_fd = None
2332
	master_fd = None
2333
	slave_fd = None
2333
	slave_fd = None
2334
	fd_pipes_orig = None
2334
	fd_pipes_orig = None
2335
	got_pty = False
2335
	if logfile:
2336
	if logfile:
2336
		del keywords["logfile"]
2337
		del keywords["logfile"]
2337
		fd_pipes = keywords.get("fd_pipes")
2338
		fd_pipes = keywords.get("fd_pipes")
Lines 2340-2349 Link Here
2340
		elif 1 not in fd_pipes or 2 not in fd_pipes:
2341
		elif 1 not in fd_pipes or 2 not in fd_pipes:
2341
			raise ValueError(fd_pipes)
2342
			raise ValueError(fd_pipes)
2342
		from pty import openpty
2343
		from pty import openpty
2343
		master_fd, slave_fd = openpty()
2344
		try:
2345
			master_fd, slave_fd = openpty()
2346
			got_pty = True
2347
		except EnvironmentError, e:
2348
			writemsg("openpty failed: '%s'\n" % str(e), noiselevel=1)
2349
			del e
2350
			master_fd, slave_fd = os.pipe()
2344
		fd_pipes.setdefault(0, sys.stdin.fileno())
2351
		fd_pipes.setdefault(0, sys.stdin.fileno())
2345
		fd_pipes_orig = fd_pipes.copy()
2352
		fd_pipes_orig = fd_pipes.copy()
2346
		if os.isatty(fd_pipes_orig[1]):
2353
		if got_pty and os.isatty(fd_pipes_orig[1]):
2347
			from output import get_term_size, set_term_size
2354
			from output import get_term_size, set_term_size
2348
			rows, columns = get_term_size()
2355
			rows, columns = get_term_size()
2349
			set_term_size(rows, columns, slave_fd)
2356
			set_term_size(rows, columns, slave_fd)
Lines 2398-2404 Link Here
2398
	if logfile:
2405
	if logfile:
2399
		log_file = open(logfile, 'a')
2406
		log_file = open(logfile, 'a')
2400
		stdout_file = os.fdopen(os.dup(fd_pipes_orig[1]), 'w')
2407
		stdout_file = os.fdopen(os.dup(fd_pipes_orig[1]), 'w')
2401
		master_file = os.fdopen(master_fd, 'w+')
2408
		master_file = os.fdopen(master_fd, 'r')
2402
		iwtd = [master_file]
2409
		iwtd = [master_file]
2403
		owtd = []
2410
		owtd = []
2404
		ewtd = []
2411
		ewtd = []

Return to bug 186876