terminalwriter: remove unneeded hasattr use
This commit is contained in:
parent
e8fc5f99fa
commit
8e04d35a33
|
@ -85,10 +85,11 @@ class TerminalWriter:
|
||||||
self.hasmarkup = should_do_markup(file)
|
self.hasmarkup = should_do_markup(file)
|
||||||
self._chars_on_current_line = 0
|
self._chars_on_current_line = 0
|
||||||
self._width_of_current_line = 0
|
self._width_of_current_line = 0
|
||||||
|
self._terminal_width = None # type: Optional[int]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def fullwidth(self) -> int:
|
def fullwidth(self) -> int:
|
||||||
if hasattr(self, "_terminal_width"):
|
if self._terminal_width is not None:
|
||||||
return self._terminal_width
|
return self._terminal_width
|
||||||
return get_terminal_width()
|
return get_terminal_width()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue