Skip to content

Commit 63cd190

Browse files
william-andrewolph
authored andcommitted
Delegate unknown attrs to target in WrappingIO
Same idea as fbb2f4d but more generic. Only the flushing should be wrapped, everything else should behave like it would on the target. The issue arises while trying to access attributes like `encoding` or `fileno`.
1 parent 9081722 commit 63cd190

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

progressbar/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ def __init__(self, target: types.IO, capturing: bool = False,
199199
self.listeners = listeners or set()
200200
self.needs_clear = False
201201

202-
def isatty(self): # pragma: no cover
203-
return self.target.isatty()
202+
def __getattr__(self, name): # pragma: no cover
203+
return getattr(self.target, name)
204204

205205
def write(self, value: str) -> None:
206206
if self.capturing:

0 commit comments

Comments
 (0)