cloudbase / PyMI

A blazing fast replacement for the Python WMI module
Apache License 2.0
21 stars 14 forks source link

Fixes get_class when the class has no attributes #6

Closed alinbalutoiu closed 8 years ago

alinbalutoiu commented 8 years ago

Doing "if cls:" will return False in the case in which the class has no attributes. The class implements the method len() which returns the number of class attributes and which is also used to test the truth value of "if cls:". In the case in which the class has only methods, the truth value will be False even if the object exists.

It is better to compare the reference of cls with None.