Skip to content

Commit d2ed429

Browse files
committed
support older versions of python
Older versions don't have .fromisoformat() function
1 parent c2b54e2 commit d2ed429

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scripts/osm2pgsql-replication

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def compute_database_date(conn, prefix):
7777
LOG.debug("Found timestamp %s", date)
7878

7979
try:
80-
date = dt.datetime.fromisoformat(date.replace('Z', '+00:00'))
80+
date = dt.datetime.strptime(date, '%Y-%m-%dT%H:%M:%SZ').replace(tzinfo=dt.timezone.utc)
8181
except ValueError:
8282
LOG.fatal("Cannot parse timestamp '%s'", date)
8383
return None

0 commit comments

Comments
 (0)