Skip to content

Commit

Permalink
Merge pull request #264 from mtmail/deprecated-utcnow
Browse files Browse the repository at this point in the history
fix two python 3.12 deprecation warnings
  • Loading branch information
lonvia authored Sep 1, 2024
2 parents df429ca + c73fa25 commit 4855a9e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/pyosmium-up-to-date
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def update_from_custom_server(url, seq, ts, options):
ts = ts.timestamp

if not options.force_update:
cmpdate = dt.datetime.utcnow() - dt.timedelta(days=90)
cmpdate = dt.datetime.now(dt.UTC) - dt.timedelta(days=90)
cmpdate = cmpdate.replace(tzinfo=dt.timezone.utc)
if ts < cmpdate:
log.error(
Expand Down Expand Up @@ -182,7 +182,7 @@ def compute_start_point(options):

def get_arg_parser(from_main=False):
def h(s):
return re.sub("\s\s+" , " ", s)
return re.sub(r'\s\s+' , " ", s)

parser = ArgumentParser(description=__doc__,
usage=None if from_main else 'pyosmium-up-to-date [options] <osm file>',
Expand Down

0 comments on commit 4855a9e

Please sign in to comment.