secs = tai2utc(secs - TAI64Base, leapsecUTCAllow)
if secs is None:
return Raw(v[0], v[1:1+l]), v[1+l:]
- if (abs(secs) > (1 << 60)) or (asecs > 0) or ((nsecs % 1000) > 0):
- # Python can represent neither big values, nor nanoseconds
+ if (asecs > 0) or ((nsecs % 1000) > 0):
+ # Python can represent neither attoseconds, nor nanoseconds
+ return Raw(v[0], v[1:1+l]), v[1+l:]
+ try:
+ dt = datetime(1970, 1, 1) + timedelta(seconds=secs)
+ except OverflowError:
return Raw(v[0], v[1:1+l]), v[1+l:]
- dt = datetime(1970, 1, 1) + timedelta(seconds=secs)
dt += timedelta(microseconds=nsecs // 1000)
return dt, v[1+l:]
if (v[0] & TagStr) > 0: