tjguk / wmi

105 stars 29 forks source link

Adds missing magic method __nonzero__ #1

Open claudiubelu opened 10 years ago

claudiubelu commented 10 years ago

This is called each time this object is an argument to a conditional statement. If this method is not present, getattr would be called instead. That would cause an endless recursive call. Strangely, this was not an issue before.

Error encountered running: conn = wmi.WMI(moniker='//./root/MSCluster') conn.MSCluster_Cluster

Also, this should improve performance as well, since it avoids useless recursive calls.