summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorKjetil Jacobsen <kjetilja@gmail.com>2002-08-28 13:18:22 +0000
committerKjetil Jacobsen <kjetilja@gmail.com>2002-08-28 13:18:22 +0000
commit39cf62a6afa49053d0ac0df2258b34249749b53d (patch)
tree17d4c158cbdc25134c35c251f77d30938b18125d /examples
parent9543012db849ae8f03344bc419f1b31774fa02a3 (diff)
downloadpycurl-39cf62a6afa49053d0ac0df2258b34249749b53d.tar.gz
trap errors when pressing the back button
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/gtkhtml_demo.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/examples/gtkhtml_demo.py b/examples/gtkhtml_demo.py
index 4d32fe9..86d7e16 100755
--- a/examples/gtkhtml_demo.py
+++ b/examples/gtkhtml_demo.py
@@ -133,11 +133,12 @@ class HtmlWindow(GtkHTML):
del forward[:]
def do_back(self, _b):
- forward.append(history[-1])
- del history[-1]
- url = history[-1]
- del history[-1]
- self.load_url(html, url)
+ if len(history) > 1:
+ forward.append(history[-1])
+ del history[-1]
+ url = history[-1]
+ del history[-1]
+ self.load_url(html, url)
def do_forward(self, _b):
if len(forward) == 0: return