a2b6af809af52297557fcb7b064e63bd4a19d2a1,Software/Python/easygopigo3.py,DHTSensor,read_temperature,#DHTSensor#,2727

Before Change



        _grab_read()
        temp = DHT.dht(self.sensor_type)[0]
        _release_read()

        if temp == -2:
            return "Bad reading, trying again"
        elif temp == -3:

After Change



        from di_sensors import DHT

        try:
            _grab_read()
            temp = DHT.dht(self.sensor_type)[0]
        except Exception as e:
            raise
        finally:
            _release_read()

        if temp == -2:
            return "Bad reading, trying again"
        elif temp == -3:
            return "Run the program as sudo"
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: DexterInd/GoPiGo3
Commit Name: a2b6af809af52297557fcb7b064e63bd4a19d2a1
Time: 2017-08-29
Author: cleoqc1124@gmail.com
File Name: Software/Python/easygopigo3.py
Class Name: DHTSensor
Method Name: read_temperature


Project Name: DexterInd/GoPiGo3
Commit Name: a2b6af809af52297557fcb7b064e63bd4a19d2a1
Time: 2017-08-29
Author: cleoqc1124@gmail.com
File Name: Software/Python/easygopigo3.py
Class Name: DHTSensor
Method Name: read


Project Name: DexterInd/GoPiGo3
Commit Name: a2b6af809af52297557fcb7b064e63bd4a19d2a1
Time: 2017-08-29
Author: cleoqc1124@gmail.com
File Name: Software/Python/easygopigo3.py
Class Name: DHTSensor
Method Name: read_humidity