X Tutup
Skip to content

Commit eeb2b89

Browse files
committed
Python compatible url* imports
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
1 parent f95b6b4 commit eeb2b89

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

bpython/repl.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@
4040
from itertools import takewhile
4141
from locale import getpreferredencoding
4242
from string import Template
43-
from urllib import quote as urlquote
44-
from urlparse import urlparse, urljoin
4543

4644
from pygments.token import Token
4745

@@ -54,6 +52,15 @@
5452
import bpython.autocomplete as autocomplete
5553

5654

55+
try:
56+
from urllib.parse import quote as urlquote
57+
from urllib.parse import urljoin
58+
from urllib.parse import urlparse
59+
except ImportError:
60+
from urllib import quote as urlquote
61+
from urlparse import urlparse, urljoin
62+
63+
5764
class RuntimeTimer(object):
5865
def __init__(self):
5966
self.reset_timer()

0 commit comments

Comments
 (0)
X Tutup