Skip to content

Commit a0a1168

Browse files
author
Melissa LeBlanc-Williams
committed
Fixed the error type to check
1 parent 6f34416 commit a0a1168

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

adafruit_featherwing/rtc_featherwing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434

3535
import time
3636
from collections import namedtuple
37-
import adafruit_ds3231
3837
from adafruit_featherwing import shared
38+
import adafruit_ds3231
3939

4040
class RTCFeatherWing:
4141
"""Class representing an `DS3231 Precision RTC FeatherWing
@@ -291,13 +291,13 @@ def unixtime(self):
291291
"""
292292
try:
293293
return time.mktime(self._rtc.datetime)
294-
except (ValueError, RuntimeError) as error:
294+
except (AttributeError, RuntimeError) as error:
295295
print("Error attempting to run time.mktime() on this board\n", error)
296296

297297
@unixtime.setter
298298
def unixtime(self, unixtime):
299299
if isinstance(unixtime, int):
300300
try:
301301
self._rtc.datetime = time.localtime(unixtime)
302-
except (ValueError, RuntimeError) as error:
302+
except (AttributeError, RuntimeError) as error:
303303
print("Error attempting to run time.localtime() on this board\n", error)

0 commit comments

Comments
 (0)