Skip to content

Commit

Permalink
Downgrading datetime.now(UTC) to work with version <3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
silverdaz committed Jul 11, 2024
1 parent 67cb95b commit 876cdcb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crypt4gh/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def decrypt(keys, infile, outfile, sender_pubkey=None, offset=0, span=None):

session_keys, edit_list, expiration, uri = header.deconstruct(infile, keys, sender_pubkey=sender_pubkey)

if expiration and (datetime.datetime.now(datetime.UTC) > expiration):
if expiration and (datetime.datetime.fromtimestamp(time.time()) > expiration):
raise ValueError(f'Expired on {expiration}')

# Infile in now positioned at the beginning of the data portion
Expand Down

0 comments on commit 876cdcb

Please sign in to comment.