Show More
@@ -755,9 +755,17 b' class PrefilterHandler(Component):' | |||
|
755 | 755 | line = line_info.line |
|
756 | 756 | continue_prompt = line_info.continue_prompt |
|
757 | 757 | |
|
758 | if (continue_prompt and self.shell.autoindent and line.isspace() and | |
|
759 | (0 < abs(len(line) - self.shell.indent_current_nsp) <= 2 or | |
|
760 |
|
|
|
758 | if (continue_prompt and | |
|
759 | self.shell.autoindent and | |
|
760 | line.isspace() and | |
|
761 | ||
|
762 | (0 < abs(len(line) - self.shell.indent_current_nsp) <= 2 | |
|
763 | or | |
|
764 | not self.shell.buffer | |
|
765 | or | |
|
766 | (self.shell.buffer[-1]).isspace() | |
|
767 | ) | |
|
768 | ): | |
|
761 | 769 | line = '' |
|
762 | 770 | |
|
763 | 771 | self.shell.log(line, line, continue_prompt) |
@@ -18,25 +18,6 b' def doctest_simple():' | |||
|
18 | 18 | """ |
|
19 | 19 | |
|
20 | 20 | |
|
21 | def doctest_run_builtins(): | |
|
22 | """Check that %run doesn't damage __builtins__ via a doctest. | |
|
23 | ||
|
24 | This is similar to the test_run_builtins, but I want *both* forms of the | |
|
25 | test to catch any possible glitches in our testing machinery, since that | |
|
26 | modifies %run somewhat. So for this, we have both a normal test (below) | |
|
27 | and a doctest (this one). | |
|
28 | ||
|
29 | In [1]: import tempfile | |
|
30 | ||
|
31 | In [3]: f = tempfile.NamedTemporaryFile() | |
|
32 | ||
|
33 | In [4]: f.write('pass\\n') | |
|
34 | ||
|
35 | In [5]: f.flush() | |
|
36 | ||
|
37 | In [7]: %run $f.name | |
|
38 | """ | |
|
39 | ||
|
40 | 21 | def doctest_multiline1(): |
|
41 | 22 | """The ipdoctest machinery must handle multiline examples gracefully. |
|
42 | 23 |
General Comments 0
You need to be logged in to leave comments.
Login now