Show More
@@ -636,7 +636,8 class TransformerManager: | |||
|
636 | 636 | MemoryError, SyntaxWarning): |
|
637 | 637 | return 'invalid', None |
|
638 | 638 | else: |
|
639 |
if len(lines) > 1 and not lines[-1].strip().endswith(':') |
|
|
639 | if len(lines) > 1 and not lines[-1].strip().endswith(':') \ | |
|
640 | and not lines[-2][:-1].endswith('\\'): | |
|
640 | 641 | return 'incomplete', find_last_indent(lines) |
|
641 | 642 | return 'complete', None |
|
642 | 643 |
@@ -206,6 +206,7 def test_check_complete(): | |||
|
206 | 206 | nt.assert_equal(cc("a = '''\n hi"), ('incomplete', 3)) |
|
207 | 207 | nt.assert_equal(cc("def a():\n x=1\n global x"), ('invalid', None)) |
|
208 | 208 | nt.assert_equal(cc("a \\ "), ('invalid', None)) # Nothing allowed after backslash |
|
209 | nt.assert_equal(cc("1\\\n+2"), ('complete', None)) | |
|
209 | 210 | |
|
210 | 211 | # no need to loop on all the letters/numbers. |
|
211 | 212 | short = '12abAB'+string.printable[62:] |
General Comments 0
You need to be logged in to leave comments.
Login now