clint icon indicating copy to clipboard operation
clint copied to clipboard

wrap stdout.isatty in try/except

Open kennethreitz opened this issue 14 years ago • 2 comments

Check for AttributeError. BPython hacks stdout and doesn't have that method available.

kennethreitz avatar Apr 08 '11 15:04 kennethreitz

Do you mean running clint-powered applications from inside of a bpython shell? If so, bpython also barfs on L31 of clint/textui/cols.py: fd_stdout = sys.stdout.fileno()

I'm not entirely sure of the benefit of hacking around bpython's hacks, but I'm not that familiar with bpython either.

[edit] Also, bpython has sys.stdout.isatty, at least the latest version on PyPi 0.10.1 on Python 2.7.2

avidal avatar Jan 07 '12 03:01 avidal

yeah, BPython monkeypatches sys.stdout, and it isn't compliant.

kennethreitz avatar Jan 07 '12 03:01 kennethreitz