From 03f51e5edb907536c20d8905d932be6e81526eb5 Mon Sep 17 00:00:00 2001 From: arigo Date: Tue, 28 Oct 2008 10:02:19 +0100 Subject: [PATCH] [svn r59464] Fix for a corner case: when the arguments are 'del'-eted from the local scope. This can also occur when using Psyco because f_locals is then empty. --HG-- branch : trunk --- py/code/frame.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/py/code/frame.py b/py/code/frame.py index 8b67ba27d..221fcd72b 100644 --- a/py/code/frame.py +++ b/py/code/frame.py @@ -50,6 +50,9 @@ class Frame(object): """ retval = [] for arg in self.code.getargs(): - retval.append((arg, self.f_locals[arg])) + try: + retval.append((arg, self.f_locals[arg])) + except KeyError: + pass # this can occur when using Psyco return retval