New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: fix timestamp inconsistencies between Windows and Linux #459
fix: fix timestamp inconsistencies between Windows and Linux #459
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #459 +/- ##
==========================================
- Coverage 98.17% 98.13% -0.05%
==========================================
Files 84 84
Lines 6699 6707 +8
==========================================
+ Hits 6577 6582 +5
- Misses 122 125 +3 ☔ View full report in Codecov by Sentry. |
try: | ||
# use to avoid timestamp inconsistances between pykiso and python can | ||
import uptime | ||
|
||
if uptime.boottime() is None: | ||
boottime_epoch = 0 | ||
else: | ||
boottime_epoch = uptime.boottime().timestamp() | ||
except ImportError: | ||
boottime_epoch = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try: | |
# use to avoid timestamp inconsistances between pykiso and python can | |
import uptime | |
if uptime.boottime() is None: | |
boottime_epoch = 0 | |
else: | |
boottime_epoch = uptime.boottime().timestamp() | |
except ImportError: | |
boottime_epoch = 0 | |
boottime_epoch = 0 | |
try: | |
# use to avoid timestamp inconsistances between pykiso and python can in linux | |
import uptime | |
if not uptime.boottime(): | |
boottime_epoch = uptime.boottime().timestamp() | |
except: | |
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally find it more explicit to set it to 0 in all failing cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also like the fact that we don't catch all errors
No description provided.