terminalwriter: remove unneeded hasattr use

This commit is contained in:
Ran Benita 2020-04-29 17:09:13 +03:00
parent e8fc5f99fa
commit 8e04d35a33
1 changed files with 2 additions and 1 deletions

View File

@ -85,10 +85,11 @@ class TerminalWriter:
self.hasmarkup = should_do_markup(file)
self._chars_on_current_line = 0
self._width_of_current_line = 0
self._terminal_width = None # type: Optional[int]
@property
def fullwidth(self) -> int:
if hasattr(self, "_terminal_width"):
if self._terminal_width is not None:
return self._terminal_width
return get_terminal_width()