Fix assertIsNone for python before 2.7