=== modified file 'django/template/context.py'
|
|
|
21 | 21 | yield d |
22 | 22 | |
23 | 23 | def push(self): |
24 | | self.dicts = [{}] + self.dicts |
| 24 | d = {} |
| 25 | self.dicts = [d] + self.dicts |
| 26 | return d |
25 | 27 | |
26 | 28 | def pop(self): |
27 | 29 | if len(self.dicts) == 1: |
28 | 30 | raise ContextPopException |
29 | | del self.dicts[0] |
| 31 | return self.dicts.pop(0) |
30 | 32 | |
31 | 33 | def __setitem__(self, key, value): |
32 | 34 | "Set a variable in the current context" |
… |
… |
|
61 | 63 | def update(self, other_dict): |
62 | 64 | "Like dict.update(). Pushes an entire dictionary's keys and values onto the context." |
63 | 65 | self.dicts = [other_dict] + self.dicts |
| 66 | return other_dict |
64 | 67 | |
65 | 68 | # This is a function rather than module-level procedural code because we only |
66 | 69 | # want it to execute if somebody uses RequestContext. |