File tree Expand file tree Collapse file tree 2 files changed +5
-13
lines changed Expand file tree Collapse file tree 2 files changed +5
-13
lines changed Original file line number Diff line number Diff line change 15
15
16
16
import os
17
17
import sys
18
- from datetime import datetime , timezone
18
+ import tomllib
19
+ from datetime import UTC , datetime
19
20
from importlib import metadata
20
21
from pathlib import Path
21
22
22
23
from sphinx .util import logging
23
24
24
- if sys .version_info < (3 , 11 ):
25
- import tomli as tomllib
26
- else :
27
- import tomllib
28
-
29
25
logger = logging .getLogger (__name__ )
30
26
31
27
try :
89
85
# -- Project information ------------------------------------------------------
90
86
project = project_meta ['name' ]
91
87
author = project_meta ['authors' ][0 ]['name' ]
92
- project_copyright = f'2011-{ datetime .now (tz = timezone . utc ).year } , { author } '
88
+ project_copyright = f'2011-{ datetime .now (tz = UTC ).year } , { author } '
93
89
github_project = 'astropy/photutils'
94
90
95
91
# The version info for the project you're documenting, acts as
Original file line number Diff line number Diff line change 5
5
"""
6
6
7
7
import sys
8
- from datetime import datetime , timezone
8
+ from datetime import UTC , datetime
9
9
10
10
11
11
def _get_version_info ():
@@ -49,11 +49,7 @@ def _get_date(utc=False):
49
49
result : str
50
50
The current date/time.
51
51
"""
52
- if not utc :
53
- now = datetime .now ().astimezone ()
54
- else :
55
- now = datetime .now (timezone .utc )
56
-
52
+ now = datetime .now ().astimezone () if not utc else datetime .now (UTC )
57
53
return now .strftime ('%Y-%m-%d %H:%M:%S %Z' )
58
54
59
55
You can’t perform that action at this time.
0 commit comments