diff options
author | luigi1111 <luigi1111w@gmail.com> | 2021-03-20 01:43:50 -0400 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2021-03-20 01:43:50 -0400 |
commit | 6776b70140c3da1b8fa70cb2c158d9f8a958e77a (patch) | |
tree | 973f9f7978c9d7c29c40e057f3fd9a505a55a314 | |
parent | Merge pull request #7394 (diff) | |
parent | python-rpc: adapt urlparse for python3 (diff) | |
download | monero-6776b70140c3da1b8fa70cb2c158d9f8a958e77a.tar.xz |
Merge pull request #7398
5984277 python-rpc: adapt urlparse for python3 (moneromooo-monero)
-rwxr-xr-x | utils/python-rpc/console.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/utils/python-rpc/console.py b/utils/python-rpc/console.py index c94e07eab..4b3c18f5d 100755 --- a/utils/python-rpc/console.py +++ b/utils/python-rpc/console.py @@ -4,7 +4,16 @@ from __future__ import print_function import sys import subprocess import socket -import urlparse +try: + import urllib.parse + url_parser = urllib.parse.urlparse +except: + try: + import urlparse + url_parser = urlparse.urlparse + except: + print('urllib or urlparse is needed') + sys.exit(1) import framework.rpc import framework.daemon import framework.wallet @@ -21,7 +30,7 @@ for n in range(1, len(sys.argv)): try: port = int(sys.argv[n]) except: - t = urlparse.urlparse(sys.argv[n], allow_fragments = False) + t = url_parser(sys.argv[n], allow_fragments = False) scheme = t.scheme or scheme host = t.hostname or host port = t.port or port |