Code optimizations wrt handling of None - bug 2212

svn: r10811
This commit is contained in:
Gerald Britton
2008-06-16 15:01:46 +00:00
parent 47095b4e98
commit 4982292774
124 changed files with 379 additions and 377 deletions

View File

@@ -138,7 +138,7 @@ def fix_encoding(value):
def xml_lang():
loc = locale.getlocale()
if loc[0] == None:
if loc[0] is None:
return ""
else:
return loc[0].replace('_', '-')
@@ -578,7 +578,7 @@ def probably_alive(person, db, current_date=None, limit=0):
(defaults to today)
limit - number of years to check beyond death_date
"""
if current_date == None:
if current_date is None:
current_date = gen.lib.Date()
# yr, mon, day:
current_date.set_yr_mon_day(*time.localtime(time.time())[0:3])