From b2a0f040ff0536ab4192cb998a6c04c0ccdd45de 2011-10-18 20:17:22 From: Fernando Perez Date: 2011-10-18 20:17:22 Subject: [PATCH] Small edits for clarity and local optimization. --- diff --git a/IPython/core/inputsplitter.py b/IPython/core/inputsplitter.py index a5469ae..b1c18a9 100644 --- a/IPython/core/inputsplitter.py +++ b/IPython/core/inputsplitter.py @@ -758,10 +758,11 @@ class IPythonInputSplitter(InputSplitter): try: push = super(IPythonInputSplitter, self).push + buf = self._buffer for line in lines_list: - if self._is_complete or not self._buffer or \ - (self._buffer and (self._buffer[-1].rstrip().endswith(':') or\ - self._buffer[-1].rstrip().endswith(','))): + if self._is_complete or not buf or \ + (buf and (buf[-1].rstrip().endswith(':') or + buf[-1].rstrip().endswith(',')) ): for f in transforms: line = f(line)