Skip to content

Commit fc01c4b

Browse files
committed
Use more new except syntax in Webware example
1 parent 39060d5 commit fc01c4b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

DBUtils/Examples/DBUtilsExample.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ class DBUtilsExample(ExamplePage):
4646
dbapi_name = config.pop('dbapi', 'pg')
4747
if dbapi_name == 'pg': # use the PyGreSQL classic DB API
4848
dbmod_name += 'Pg'
49-
if config.has_key('database'):
49+
if 'datanbase' in config:
5050
config['dbname'] = config['database']
5151
del config['database']
52-
if config.has_key('password'):
52+
if 'password' in config:
5353
config['passwd'] = config['password']
5454
del config['password']
5555
else: # use a DB-API 2 compliant module
@@ -231,7 +231,7 @@ def listAttendees(self):
231231
places = {}
232232
for i in id:
233233
i = i[:4].rstrip()
234-
if places.has_key(i):
234+
if i in places:
235235
places[i] += 1
236236
else:
237237
places[i] = 1

0 commit comments

Comments
 (0)