'Extend base class method: Stuff the source in the line cache first'

def runsource(self, source):

    filename = self.stuffsource(source)
    self.more = 0
    self.save_warnings_filters = warnings.filters[:]
    warnings.filterwarnings(action='error', category=SyntaxWarning)
    if isinstance(source, types.UnicodeType):
        from idlelib import IOBinding
        try:
            source = source.encode(IOBinding.encoding)
        except UnicodeError:
            self.tkconsole.resetoutput()
            self.write('Unsupported    characters    in    input\n')
            return
    try:
        return InteractiveInterpreter.runsource(self, source, filename)
    finally:
        if (self.save_warnings_filters is not None):
            warnings.filters[:] = self.save_warnings_filters
            self.save_warnings_filters = None
