mercurial/scmposix.py
changeset 30310 5c379b1f56c7
parent 30309 4b1af1c867fa
child 30311 80708959161a
equal deleted inserted replaced
30309:4b1af1c867fa 30310:5c379b1f56c7
    39     if sys.platform == 'plan9':
    39     if sys.platform == 'plan9':
    40         return [encoding.environ['home'] + '/lib/hgrc']
    40         return [encoding.environ['home'] + '/lib/hgrc']
    41     else:
    41     else:
    42         return [os.path.expanduser('~/.hgrc')]
    42         return [os.path.expanduser('~/.hgrc')]
    43 
    43 
    44 def termwidth():
    44 def termwidth(ui):
    45     try:
    45     try:
    46         import array
    46         import array
    47         import termios
    47         import termios
    48         for dev in (sys.stderr, sys.stdout, sys.stdin):
    48         for dev in (ui.ferr, ui.fout, ui.fin):
    49             try:
    49             try:
    50                 try:
    50                 try:
    51                     fd = dev.fileno()
    51                     fd = dev.fileno()
    52                 except AttributeError:
    52                 except AttributeError:
    53                     continue
    53                     continue