catch errors thrown by os.tcgetpgrp(), patch provided by walters

This commit is contained in:
Mike Bonnet 2007-06-05 01:07:32 -04:00
parent 79ef5b41f2
commit b1a7b52e4e

View file

@ -551,7 +551,10 @@ def _progress_callback(uploaded, total, piece, time, total_time):
sys.stdout.flush()
def _running_in_bg():
if (not os.isatty(0)) or (os.getpgrp() != os.tcgetpgrp(0)):
try:
if (not os.isatty(0)) or (os.getpgrp() != os.tcgetpgrp(0)):
return True
except OSError, e:
return True
return False