Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_unfrozen_datetime():
try:
# if freezegun could be active, we need to use real_datetime to ensure we use the actual time instead of the
# time set by freezegun.
# we have to import this at the last possible moment because birdeye is very likely to be imported before
# freezegun is activated.
from freezegun.api import real_datetime
except ImportError:
from datetime import datetime as real_datetime
return real_datetime.now()
def get_unfrozen_datetime():
try:
# if freezegun could be active, we need to use real_datetime to ensure we use the actual time instead of the
# time set by freezegun.
# we have to import this at the last possible moment because birdeye is very likely to be imported before
# freezegun is activated.
from freezegun.api import real_datetime
except ImportError:
from datetime import datetime as real_datetime
return real_datetime.now()