File: err_176.py

package info (click to toggle)
python-refurb 1.27.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,700 kB
  • sloc: python: 9,468; makefile: 40; sh: 6
file content (12 lines) | stat: -rw-r--r-- 343 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
import datetime as dt
from datetime import datetime, timezone

# Should warn:
start_date = datetime.utcnow()
old_date = datetime.utcfromtimestamp(1)
start_date = dt.datetime.utcnow()
old_date = dt.datetime.utcfromtimestamp(1)

# Should not warn:
start_date = datetime.now(tz=timezone.utc)
old_date = datetime.fromtimestamp(1, tz=timezone.utc)