Skip to content

Commit

Permalink
Fix reference to datetime.UTC for Python3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
sven-oly committed Nov 14, 2024
1 parent 7baf864 commit f799e83
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions testgen/generators/datetime_fmt.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from datetime import datetime, timezone, UTC
from datetime import datetime, timezone
# import pytz

import os
Expand Down Expand Up @@ -85,7 +85,7 @@ def generate_datetime_data_from_cldr(self, dt_json_path, run_limit=-1):
options['calendar'] = 'gregory'

# Generate UTC time equivalent and get the offset in seconds
u_time = raw_time.astimezone(UTC)
u_time = raw_time.astimezone(timezone.utc)
input_string = u_time.isoformat().replace('+00:00', 'Z')
tz_offset_secs = raw_time.utcoffset().total_seconds()

Expand All @@ -100,6 +100,7 @@ def generate_datetime_data_from_cldr(self, dt_json_path, run_limit=-1):
verify_cases.append(new_verify)



# Save output as: datetime_fmt_test.json and datetime_fmt_verify.json
test_obj['tests'] = test_cases
verify_obj['verifications'] = verify_cases
Expand Down

0 comments on commit f799e83

Please sign in to comment.