view roundup/anypy/datetime_.py @ 8240:1189c742e4b3

fix: crash roundup-admin perftest password without rounds= argument. If the rounds value is taken from the config file, it doesn't need to be parsed into an int.
author John Rouillard <rouilj@ieee.org>
date Mon, 30 Dec 2024 02:59:27 -0500
parents d5d7ecd31864
children
line wrap: on
line source

# https://issues.roundup-tracker.org/issue2551278
# datetime.utcnow deprecated
try:
    from datetime import UTC, datetime

    def utcnow():
        return datetime.now(UTC)

except ImportError:
    from datetime import datetime

    def utcnow():
        return datetime.utcnow()

Roundup Issue Tracker: http://roundup-tracker.org/