diff --git a/fastprogress/fastprogress.py b/fastprogress/fastprogress.py index 177b327..adbcd6c 100644 --- a/fastprogress/fastprogress.py +++ b/fastprogress/fastprogress.py @@ -208,7 +208,7 @@ def update_graph(self, graphs, x_bounds=None, y_bounds=None, figsize=(6,4)): # Cell def printing(): - return False if NO_BAR else (stdout.isatty() or IN_NOTEBOOK) + return False if NO_BAR else (hasattr(stdout, 'isatty') and stdout.isatty() or IN_NOTEBOOK) # Cell class ConsoleProgressBar(ProgressBar): diff --git a/nbs/01_fastprogress.ipynb b/nbs/01_fastprogress.ipynb index 3e4d8b0..b3c51d4 100644 --- a/nbs/01_fastprogress.ipynb +++ b/nbs/01_fastprogress.ipynb @@ -545,7 +545,7 @@ "source": [ "#export \n", "def printing():\n", - " return False if NO_BAR else (stdout.isatty() or IN_NOTEBOOK)" + " return False if NO_BAR else (hasattr(stdout, 'isatty') and stdout.isatty() or IN_NOTEBOOK)" ] }, {