| OLD | NEW |
| 1 // Copyright (c) Corporation for National Research Initiatives | 1 // Copyright (c) Corporation for National Research Initiatives |
| 2 package org.python.core; | 2 package org.python.core; |
| 3 | 3 |
| 4 /** | 4 /** |
| 5 * A Python frame object. | 5 * A Python frame object. |
| 6 */ | 6 */ |
| 7 public class PyFrame extends PyObject | 7 public class PyFrame extends PyObject |
| 8 { | 8 { |
| 9 public PyFrame f_back; | 9 public PyFrame f_back; |
| 10 | 10 |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 tracefunc = null; | 161 tracefunc = null; |
| 162 } else { | 162 } else { |
| 163 throwReadonly(name); | 163 throwReadonly(name); |
| 164 } | 164 } |
| 165 // not yet implemented: | 165 // not yet implemented: |
| 166 // f_exc_type | 166 // f_exc_type |
| 167 // f_exc_value | 167 // f_exc_value |
| 168 // f_exc_traceback | 168 // f_exc_traceback |
| 169 } | 169 } |
| 170 | 170 |
| 171 public PyObject __findattr__(String name) { | 171 public PyObject __findattr_ex__(String name) { |
| 172 if (name == "f_locals") { | 172 if (name == "f_locals") { |
| 173 return getLocals(); | 173 return getLocals(); |
| 174 } else if (name == "f_trace") { | 174 } else if (name == "f_trace") { |
| 175 if (tracefunc instanceof PythonTraceFunction) { | 175 if (tracefunc instanceof PythonTraceFunction) { |
| 176 return ((PythonTraceFunction)tracefunc).tracefunc; | 176 return ((PythonTraceFunction)tracefunc).tracefunc; |
| 177 } | 177 } |
| 178 return Py.None; | 178 return Py.None; |
| 179 } | 179 } |
| 180 return super.__findattr__(name); | 180 return super.__findattr_ex__(name); |
| 181 } | 181 } |
| 182 | 182 |
| 183 /** | 183 /** |
| 184 * Return the locals dict. First merges the fast locals into | 184 * Return the locals dict. First merges the fast locals into |
| 185 * f_locals, then returns the updated f_locals. | 185 * f_locals, then returns the updated f_locals. |
| 186 * | 186 * |
| 187 * @return a PyObject mapping of locals | 187 * @return a PyObject mapping of locals |
| 188 */ | 188 */ |
| 189 public PyObject getLocals() { | 189 public PyObject getLocals() { |
| 190 if (f_locals == null) { | 190 if (f_locals == null) { |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 } | 382 } |
| 383 | 383 |
| 384 public void setderef(int index, PyObject value) { | 384 public void setderef(int index, PyObject value) { |
| 385 f_env[index].ob_ref = value; | 385 f_env[index].ob_ref = value; |
| 386 } | 386 } |
| 387 | 387 |
| 388 public void to_cell(int parm_index, int env_index) { | 388 public void to_cell(int parm_index, int env_index) { |
| 389 f_env[env_index].ob_ref = f_fastlocals[parm_index]; | 389 f_env[env_index].ob_ref = f_fastlocals[parm_index]; |
| 390 } | 390 } |
| 391 } | 391 } |
| OLD | NEW |