Skip to content

Commit

Permalink
Fix PytzUsageWarning (#1109)
Browse files Browse the repository at this point in the history
  • Loading branch information
serhii73 authored Nov 12, 2024
1 parent a4144c6 commit 47acb88
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions dateparser/freshness_date_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,7 @@ def apply_time(dateobj, timeobj):
now = now.replace(tzinfo=ptz)

if not now.tzinfo:
if hasattr(self.get_local_tz(), "localize"):
now = self.get_local_tz().localize(now)
else:
now = now.replace(tzinfo=self.get_local_tz())
now = now.replace(tzinfo=self.get_local_tz())

elif ptz:
localized_now = datetime.now(ptz)
Expand Down

0 comments on commit 47acb88

Please sign in to comment.