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