s/type(val) == type({})/isinstance(val, dict)

This needs to be changed everwhere in the code because
isinstance will match derived types where == will not
This commit is contained in:
John (J5) Palmieri 2006-10-03 14:32:29 -04:00
parent be29c542bf
commit 7c342e75bf

View File

@ -315,7 +315,7 @@ class Service(gobject.GObject):
"""Set the service's properties from either an Avahi """Set the service's properties from either an Avahi
TXT record (a list of lists of integers), or a TXT record (a list of lists of integers), or a
python dictionary.""" python dictionary."""
if type(properties) != type({}): if not isinstance (properties, dict):
raise ValueError("Properties must be a dictionary.") raise ValueError("Properties must be a dictionary.")
# Make sure the properties are actually different # Make sure the properties are actually different