File tree 1 file changed +3
-4
lines changed
1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 9
9
import datetime
10
10
import gzip
11
11
import importlib .resources
12
- import importlib .resources .abc
13
12
import json
14
13
15
14
import platformdirs
18
17
19
18
content : dict [str , str ] = {"START" : "1970-01-01" , "OFFSETS_GZ" : "H4sIAFNx1mYC/wMAAAAAAAAAAAA=" }
20
19
21
- path : importlib .resources .abc .Traversable
20
+ path = importlib .resources .files ("wwvb" ) / "iersdata.json"
21
+ content = json .loads (path .read_text (encoding = "utf-8" ))
22
22
23
23
for location in [ # pragma no branch
24
24
platformdirs .user_data_path ("wwvbpy" , "unpythonic.net" ),
25
25
platformdirs .site_data_path ("wwvbpy" , "unpythonic.net" ),
26
26
]:
27
27
path = location / "iersdata.json"
28
28
if path .exists (): # pragma no branch
29
+ content = json .loads (path .read_text (encoding = "utf-8" ))
29
30
break
30
- else : # pragma no cover
31
- path = importlib .resources .files ("wwvb" ) / "iersdata.json"
32
31
33
32
content = json .loads (path .read_text (encoding = "utf-8" ))
34
33
You can’t perform that action at this time.
0 commit comments