diff --git a/wlauto/utils/misc.py b/wlauto/utils/misc.py index 121fac68..ac770d59 100644 --- a/wlauto/utils/misc.py +++ b/wlauto/utils/misc.py @@ -523,9 +523,9 @@ def load_class(classpath): def get_pager(): """Returns the name of the system pager program.""" pager = os.getenv('PAGER') - if not pager: + if pager is None: pager = find_executable('less') - if not pager: + if pager is None: pager = find_executable('more') return pager diff --git a/wlauto/utils/terminalsize.py b/wlauto/utils/terminalsize.py index c9fc430f..828ca3e6 100644 --- a/wlauto/utils/terminalsize.py +++ b/wlauto/utils/terminalsize.py @@ -20,13 +20,12 @@ def get_terminal_size(): if current_os == 'Windows': tuple_xy = _get_terminal_size_windows() if tuple_xy is None: + # needed for window's python in cygwin's xterm tuple_xy = _get_terminal_size_tput() - # needed for window's python in cygwin's xterm! if current_os in ['Linux', 'Darwin'] or current_os.startswith('CYGWIN'): tuple_xy = _get_terminal_size_linux() - if tuple_xy is None: - print "default" - tuple_xy = (80, 25) # default value + if tuple_xy is None or tuple_xy == (0, 0): + tuple_xy = (80, 25) # assume "standard" terminal return tuple_xy