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

« back to all changes in this revision

Viewing changes to scripts/python-console

  • Committer: mattgiuca
  • Date: 2008-03-15 02:36:21 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:691
python-console: Removed "locls" dictionary when calling exec.
    This was causing variables to be written to locals instead of globals,
    and thus they would not be available to other functions.
    (So as a result of this, functions can see globals and call each other,
    including recursion).

Show diffs side-by-side

added added

removed removed

Lines of Context:
108
108
            sys.stdin = StdinFromWeb(self.cmdQ, self.lineQ)
109
109
            sys.stdout = self.stdout
110
110
            sys.stderr = self.stdout
111
 
            res = eval(cmd, self.globs, self.locls)
 
111
            res = eval(cmd, self.globs)
112
112
            self.stdout.flush()
113
113
            self.cmdQ.put({"okay":res})
114
114
            self.curr_cmd = ''
120
120
    def run(self):
121
121
        self.globs = {}
122
122
        self.globs['__builtins__'] = globals()['__builtins__']
123
 
        self.locls = {}
124
123
        self.curr_cmd = ''
125
124
        compiler = codeop.CommandCompiler()
126
125