mirror of
https://github.com/monero-project/monero.git
synced 2024-12-23 03:59:33 +00:00
Merge pull request #7398
5984277
python-rpc: adapt urlparse for python3 (moneromooo-monero)
This commit is contained in:
commit
6776b70140
1 changed files with 11 additions and 2 deletions
|
@ -4,7 +4,16 @@ from __future__ import print_function
|
||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
import socket
|
import socket
|
||||||
|
try:
|
||||||
|
import urllib.parse
|
||||||
|
url_parser = urllib.parse.urlparse
|
||||||
|
except:
|
||||||
|
try:
|
||||||
import urlparse
|
import urlparse
|
||||||
|
url_parser = urlparse.urlparse
|
||||||
|
except:
|
||||||
|
print('urllib or urlparse is needed')
|
||||||
|
sys.exit(1)
|
||||||
import framework.rpc
|
import framework.rpc
|
||||||
import framework.daemon
|
import framework.daemon
|
||||||
import framework.wallet
|
import framework.wallet
|
||||||
|
@ -21,7 +30,7 @@ for n in range(1, len(sys.argv)):
|
||||||
try:
|
try:
|
||||||
port = int(sys.argv[n])
|
port = int(sys.argv[n])
|
||||||
except:
|
except:
|
||||||
t = urlparse.urlparse(sys.argv[n], allow_fragments = False)
|
t = url_parser(sys.argv[n], allow_fragments = False)
|
||||||
scheme = t.scheme or scheme
|
scheme = t.scheme or scheme
|
||||||
host = t.hostname or host
|
host = t.hostname or host
|
||||||
port = t.port or port
|
port = t.port or port
|
||||||
|
|
Loading…
Reference in a new issue