Skip to content

Commit ee1bc0c

Browse files
committed
Kill Py2 in the sphinx role.
1 parent 6e1281a commit ee1bc0c

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

docs/jsonschema_role.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
from datetime import datetime
22
import errno
33
import os
4+
import urllib.request
45

56
from docutils import nodes
6-
7-
try:
8-
import urllib2 as urllib
9-
except ImportError:
10-
import urllib.request as urllib
11-
127
from lxml import html
138
import certifi
149

@@ -69,8 +64,8 @@ def fetch_or_load(spec_path):
6964
if error.errno != errno.ENOENT:
7065
raise
7166

72-
request = urllib.Request(VALIDATION_SPEC, headers=headers)
73-
response = urllib.urlopen(request, cafile=certifi.where())
67+
request = urllib.request.Request(VALIDATION_SPEC, headers=headers)
68+
response = urllib.request.urlopen(request, cafile=certifi.where())
7469

7570
if response.code == 200:
7671
with open(spec_path, "w+b") as spec:

0 commit comments

Comments
 (0)