##// 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 # inconsistent code/source attributes.
388 # inconsistent code/source attributes.
389 self.code, self._is_complete = None, None
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 self._update_indent(lines)
395 self._update_indent(lines)
392 try:
396 try:
393 self.code = self._compile(source)
397 self.code = self._compile(source)
@@ -247,6 +247,13 b' class InputSplitterTestCase(unittest.TestCase):'
247 isp.push('')
247 isp.push('')
248 self.assertFalse(isp.push_accepts_more())
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 def test_syntax_error(self):
257 def test_syntax_error(self):
251 isp = self.isp
258 isp = self.isp
252 # Syntax errors immediately produce a 'ready' block, so the invalid
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