view roundup/anypy/datetime_.py @ 8089:f2b049b49fca

fix: replace hardcoded 'html' as template directory Template directory is now determined by loading the config file from the tracker home and using the template setting. Also fixed error message when polib import fails to indicate extraction is only from thml templates.
author John Rouillard <rouilj@ieee.org>
date Tue, 16 Jul 2024 01:28:15 -0400
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/