Skip to content

Commit

Permalink
Fix two-exception except clause.
Browse files Browse the repository at this point in the history
Caught by pychecker.
  • Loading branch information
Jeremy Hylton committed Sep 24, 2002
1 parent bb7bfb3 commit 5952f27
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pDocumentTemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
__doc__='''Python implementations of document template some features
$Id: pDocumentTemplate.py,v 1.36 2002/08/14 22:29:53 mj Exp $'''
__version__='$Revision: 1.36 $'[11:-2]
$Id: pDocumentTemplate.py,v 1.37 2002/09/24 22:07:31 jeremy Exp $'''
__version__='$Revision: 1.37 $'[11:-2]

import sys, types

Expand Down Expand Up @@ -97,8 +97,11 @@ def __init__(self): self.dicts=[]

def __getitem__(self, key):
for d in self.dicts:
try: return d[key]
except KeyError, AttributeError: pass
try:
return d[key]
except (KeyError, AttributeError):
# XXX How do we get an AttributeError?
pass
raise KeyError, key

def push(self,d): self.dicts.insert(0,d)
Expand Down

0 comments on commit 5952f27

Please sign in to comment.