diff --git a/dev_utils/dev_utils/service_helper_sync.py b/dev_utils/dev_utils/service_helper_sync.py index 6861b8dc7..c35c33233 100644 --- a/dev_utils/dev_utils/service_helper_sync.py +++ b/dev_utils/dev_utils/service_helper_sync.py @@ -252,7 +252,7 @@ def on_event_batch(partition_context, events): if device_id == self.device_id and module_id == self.module_id: converted_event = self._convert_incoming_event(event) - if type(converted_event) == EventhubEvent: + if isinstance(converted_event, EventhubEvent): if "message-id" in converted_event.system_properties: logger.info( "Received event with msgid={}".format( diff --git a/samples/pnp/simple_thermostat.py b/samples/pnp/simple_thermostat.py index 2ea144447..b935d7a6b 100644 --- a/samples/pnp/simple_thermostat.py +++ b/samples/pnp/simple_thermostat.py @@ -40,7 +40,7 @@ async def reboot_handler(values): global min_temp global avg_temp_list global target_temperature - if values and type(values) == int: + if isinstance(values, int): print("Rebooting after delay of {delay} secs".format(delay=values)) asyncio.sleep(values) max_temp = None