Show More
@@ -0,0 +1,19 b'' | |||||
|
1 | #----------------------------------------------------------------------------- | |||
|
2 | # Copyright (C) 2010 The IPython Development Team. | |||
|
3 | # | |||
|
4 | # Distributed under the terms of the BSD License. | |||
|
5 | # | |||
|
6 | # The full license is in the file COPYING.txt, distributed with this software. | |||
|
7 | #----------------------------------------------------------------------------- | |||
|
8 | import io | |||
|
9 | ||||
|
10 | from IPython.core import page | |||
|
11 | ||||
|
12 | def test_detect_screen_size(): | |||
|
13 | """Simple smoketest for page._detect_screen_size.""" | |||
|
14 | try: | |||
|
15 | page._detect_screen_size(True, 25) | |||
|
16 | except (TypeError, io.UnsupportedOperation): | |||
|
17 | # This can happen in the test suite, because stdout may not have a | |||
|
18 | # fileno. | |||
|
19 | pass |
@@ -31,6 +31,8 b' import re' | |||||
31 | import sys |
|
31 | import sys | |
32 | import tempfile |
|
32 | import tempfile | |
33 |
|
33 | |||
|
34 | from io import UnsupportedOperation | |||
|
35 | ||||
34 | from IPython.core import ipapi |
|
36 | from IPython.core import ipapi | |
35 | from IPython.core.error import TryNext |
|
37 | from IPython.core.error import TryNext | |
36 | from IPython.utils.cursesimport import use_curses |
|
38 | from IPython.utils.cursesimport import use_curses | |
@@ -180,7 +182,7 b' def page(strng, start=0, screen_lines=0, pager_cmd=None):' | |||||
180 | if screen_lines <= 0: |
|
182 | if screen_lines <= 0: | |
181 | try: |
|
183 | try: | |
182 | screen_lines += _detect_screen_size(use_curses, screen_lines_def) |
|
184 | screen_lines += _detect_screen_size(use_curses, screen_lines_def) | |
183 |
except |
|
185 | except (TypeError, UnsupportedOperation): | |
184 | print >>io.stdout, str_toprint |
|
186 | print >>io.stdout, str_toprint | |
185 | return |
|
187 | return | |
186 |
|
188 |
General Comments 0
You need to be logged in to leave comments.
Login now