diff options
author | pjenvey <devnull@localhost> | 2006-12-02 04:41:59 +0000 |
---|---|---|
committer | pjenvey <devnull@localhost> | 2006-12-02 04:41:59 +0000 |
commit | 7102d96a007b8356527eb1a5b8d240aadddfc38b (patch) | |
tree | 7ad9a12b4a58af78b3ff3aa84aba5635c206baa9 /paste/registry.py | |
parent | 4025ab928d8c3e5e0647c659413989e6d73975a5 (diff) | |
download | paste-7102d96a007b8356527eb1a5b8d240aadddfc38b.tar.gz |
small refactor
Diffstat (limited to 'paste/registry.py')
-rw-r--r-- | paste/registry.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/paste/registry.py b/paste/registry.py index 57bd0c4..05bca7b 100644 --- a/paste/registry.py +++ b/paste/registry.py @@ -401,13 +401,13 @@ class StackedObjectRestorer(object): reglists = self.saved_registry_states[request_id] # The top of the stack was current when the exception occurred - stack_level = -1 + stack_level = len(reglists) - 1 reglist = reglists[stack_level] stacked_id = id(stacked) # The StackedObjectProxy may not have been registered by the # RegistryManager that was active when the exception was raised. If it # wasn't, continue searching down the stack until it's found - while stacked_id not in reglist and -stack_level <= len(reglists): + while stacked_id not in reglist and stack_level > 0: stack_level -= 1 reglist = reglists[stack_level] return reglist[id(stacked)][1] |