##// END OF EJS Templates
Fix bug with lines ending in continuation markers (\)....
Fernando Perez -
Show More
@@ -388,6 +388,10 b' class InputSplitter(object):'
388 388 # inconsistent code/source attributes.
389 389 self.code, self._is_complete = None, None
390 390
391 # Honor termination lines properly
392 if source.rstrip().endswith('\\'):
393 return False
394
391 395 self._update_indent(lines)
392 396 try:
393 397 self.code = self._compile(source)
@@ -247,6 +247,13 b' class InputSplitterTestCase(unittest.TestCase):'
247 247 isp.push('')
248 248 self.assertFalse(isp.push_accepts_more())
249 249
250 def test_continuation(self):
251 isp = self.isp
252 isp.push("import os, \\")
253 self.assertTrue(isp.push_accepts_more())
254 isp.push("sys")
255 self.assertFalse(isp.push_accepts_more())
256
250 257 def test_syntax_error(self):
251 258 isp = self.isp
252 259 # Syntax errors immediately produce a 'ready' block, so the invalid
General Comments 0
You need to be logged in to leave comments. Login now