From 8fdf9ff7468ccfbde135c1b9ba4e4c7d8f942e9d Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Fri, 7 Nov 2014 15:47:42 +0100 Subject: [PATCH] Probable fix for an Issue #908 --- lib/core/common.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index 06004d9a7..eec126bc5 100755 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -1693,12 +1693,13 @@ def getConsoleWidth(default=80): width = int(os.getenv("COLUMNS")) else: try: - process = execute("stty size", shell=True, stdout=PIPE, stderr=PIPE) - stdout, _ = process.communicate() - items = stdout.split() + with open(os.devnull, 'w') as FNULL: + process = execute("stty size", shell=True, stdout=PIPE, stderr=FNULL) + stdout, _ = process.communicate() + items = stdout.split() - if len(items) == 2 and items[1].isdigit(): - width = int(items[1]) + if len(items) == 2 and items[1].isdigit(): + width = int(items[1]) except OSError: pass