From e7a8cc3b8b8b105372f9824894e9d1be2e2056c8 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 3 Oct 2022 17:38:55 -0700 Subject: [PATCH] fix unbuffer --- jc/cli.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/jc/cli.py b/jc/cli.py index f3cd7eba..fd16a07c 100644 --- a/jc/cli.py +++ b/jc/cli.py @@ -68,7 +68,6 @@ class JcCli(): self.custom_colors: Dict = {} self.show_hidden = False self.ascii_only = False - self.flush = False self.json_separators = (',', ':') self.json_indent = None self.path_string = None @@ -386,17 +385,17 @@ Examples: """Safely prints JSON or YAML output in both UTF-8 and ASCII systems""" if self.yaml_output: try: - print(self.yaml_out(), flush=self.flush) + print(self.yaml_out(), flush=self.unbuffer) except UnicodeEncodeError: self.ascii_only = True - print(self.yaml_out(), flush=self.flush) + print(self.yaml_out(), flush=self.unbuffer) else: try: - print(self.json_out(), flush=self.flush) + print(self.json_out(), flush=self.unbuffer) except UnicodeEncodeError: self.ascii_only = True - print(self.json_out(), flush=self.flush) + print(self.json_out(), flush=self.unbuffer) def magic_parser(self): """