~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to scripts/python-console

  • Committer: wagrant
  • Date: 2008-12-23 05:23:56 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:1066
Fix the console to use codeop.CommandCompiler, which remembers activated
feature flags. This lets __future__ imports work in the console.

Show diffs side-by-side

added added

removed removed

Lines of Context:
153
153
        self.cmdQ = cmdQ
154
154
        self.lineQ = lineQ
155
155
        self.webio = WebIO(self.cmdQ, self.lineQ)
 
156
        self.cc = codeop.CommandCompiler()
156
157
        Thread.__init__(self)
157
158
 
158
159
    def execCmd(self, cmd):
207
208
 
208
209
        # Try to execute the buffer
209
210
        try:
210
 
            cmd = codeop.compile_command(self.curr_cmd, '<web session>')
 
211
            cmd = self.cc(self.curr_cmd, '<web session>')
211
212
            if cmd is None:
212
213
                # The command was incomplete, so send back a None, so the              
213
214
                # client can print a '...'