Python3 fixes

This commit is contained in:
Nedko Arnaudov 2023-11-19 18:55:48 +02:00 committed by leamas
parent ec9098d3bd
commit ffd0978253
2 changed files with 6 additions and 13 deletions

17
irccat
View File

@ -24,15 +24,15 @@ import socket
def error(why):
print "Error: " + why
print "Use -h for help"
print("Error: " + why)
print("Use -h for help")
sys.exit(1)
sys.argv.pop(0)
try:
if sys.argv[0] == '-h' or sys.argv[0] == '--help':
print usage
print(usage)
sys.exit(0)
elif sys.argv[0] == '-s':
sys.argv.pop(0)
@ -53,13 +53,6 @@ if not text:
error("too few arguments.")
s = socket.create_connection((host, port))
s.send('%s;%s;%s\n' % (section, pw, text))
#s.send('%s;%s;%s\n' % (section, pw, text))
s.send(('%s;%s;%s\n' % (section, pw, text)).encode())
s.close()

View File

@ -367,7 +367,7 @@ class Irccat(callbacks.Plugin):
Print list of sections.
"""
msg = ' '.join(self.config.keys())
msg = ' '.join(list(self.config.keys()))
irc.reply(msg if msg else 'No sections defined')
sectionlist = wrap(sectionlist, [admin])