Use 'key in dict' instead of deprecated 'dict.has_key(key)'

This commit is contained in:
Thibault Févry 2011-03-25 19:48:21 +00:00
parent d690d87f35
commit 3b7e87fc93

View file

@ -426,7 +426,7 @@ if __name__ == "__main__":
print "\n\nNo page defined, dropped."
return
if not file_map.has_key(header[0]):
if not header[0] in file_map:
file_map[header[0]] = []
file_map[header[0]].append([header[1], body])
@ -484,7 +484,7 @@ if __name__ == "__main__":
global macro_map
if not macro_map.has_key(macro.group(1)):
if not macro.group(1) in macro_map:
print "Macro '%s' is not defined." % macro.group(1)
return macro.group(0)
@ -508,7 +508,7 @@ if __name__ == "__main__":
global macro_map
if macro_map.has_key(macro.group(1)):
if macro.group(1) in macro_map:
print "Macro '%s' is being redefined." % macro.group(1)
macro_map[macro.group(1)] = macro.group(2)