mirror of
https://github.com/rsyslog/rsyslog.git
synced 2026-06-20 13:22:56 +02:00
Merge pull request #3997 from rgerhards/python3
testbench: improve python3 support
This commit is contained in:
commit
aa0f2d6cfc
@ -3,9 +3,12 @@
|
|||||||
# written 2018-11-05 by Rainer Gerhards
|
# written 2018-11-05 by Rainer Gerhards
|
||||||
# part of the rsyslog testbench, released under ASL 2.0
|
# part of the rsyslog testbench, released under ASL 2.0
|
||||||
import sys
|
import sys
|
||||||
import urllib
|
try:
|
||||||
|
from urllib.parse import quote_plus
|
||||||
|
except ImportError:
|
||||||
|
from urllib import quote_plus
|
||||||
|
|
||||||
if len(sys.argv) != 2:
|
if len(sys.argv) != 2:
|
||||||
print("ERROR: urlencode needs exactly one string as argument")
|
print("ERROR: urlencode needs exactly one string as argument")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
print(urllib.quote_plus(sys.argv[1]))
|
print(quote_plus(sys.argv[1]))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user