diff --git a/evennia/server/evennia_launcher.py b/evennia/server/evennia_launcher.py index 7c5907b222..fb711b3cef 100644 --- a/evennia/server/evennia_launcher.py +++ b/evennia/server/evennia_launcher.py @@ -501,7 +501,7 @@ def _print_info(portal_info_dict, server_info_dict): def _prepare_dict(dct): out = {} - for key, value in dct.iteritems(): + for key, value in dct.items(): if isinstance(value, list): value = "\n{}".format(ind).join(value) out[key] = value @@ -576,9 +576,9 @@ class MsgStatus(amp.Command): """ key = "MsgStatus" - arguments = [('status', amp.String())] - errors = {Exception: 'EXCEPTION'} - response = [('status', amp.String())] + arguments = [(b'status', amp.String())] + errors = {Exception: b'EXCEPTION'} + response = [(b'status', amp.String())] class MsgLauncher2Portal(amp.Command): @@ -587,9 +587,9 @@ class MsgLauncher2Portal(amp.Command): """ key = "MsgLauncher2Portal" - arguments = [('operation', amp.String()), - ('arguments', amp.String())] - errors = {Exception: 'EXCEPTION'} + arguments = [(b'operation', amp.String()), + (b'arguments', amp.String())] + errors = {Exception: b'EXCEPTION'} response = [] diff --git a/evennia/server/portal/amp.py b/evennia/server/portal/amp.py index 71a1bcba91..c3882c22dd 100644 --- a/evennia/server/portal/amp.py +++ b/evennia/server/portal/amp.py @@ -4,18 +4,15 @@ The AMP (Asynchronous Message Protocol)-communication commands and constants use This module acts as a central place for AMP-servers and -clients to get commands to use. """ -from __future__ import print_function + from functools import wraps import time from twisted.protocols import amp from collections import defaultdict, namedtuple -from cStringIO import StringIO +from io import StringIO from itertools import count import zlib # Used in Compressed class -try: - import cPickle as pickle -except ImportError: - import pickle +import pickle from twisted.internet.defer import DeferredList, Deferred from evennia.utils.utils import to_str, variable_from_module @@ -159,9 +156,9 @@ class MsgLauncher2Portal(amp.Command): """ key = "MsgLauncher2Portal" - arguments = [('operation', amp.String()), - ('arguments', amp.String())] - errors = {Exception: 'EXCEPTION'} + arguments = [(b'operation', amp.String()), + (b'arguments', amp.String())] + errors = {Exception: b'EXCEPTION'} response = [] @@ -171,8 +168,8 @@ class MsgPortal2Server(amp.Command): """ key = "MsgPortal2Server" - arguments = [('packed_data', Compressed())] - errors = {Exception: 'EXCEPTION'} + arguments = [(b'packed_data', Compressed())] + errors = {Exception: b'EXCEPTION'} response = [] @@ -182,8 +179,8 @@ class MsgServer2Portal(amp.Command): """ key = "MsgServer2Portal" - arguments = [('packed_data', Compressed())] - errors = {Exception: 'EXCEPTION'} + arguments = [(b'packed_data', Compressed())] + errors = {Exception: b'EXCEPTION'} response = [] @@ -196,8 +193,8 @@ class AdminPortal2Server(amp.Command): """ key = "AdminPortal2Server" - arguments = [('packed_data', Compressed())] - errors = {Exception: 'EXCEPTION'} + arguments = [(b'packed_data', Compressed())] + errors = {Exception: b'EXCEPTION'} response = [] @@ -210,8 +207,8 @@ class AdminServer2Portal(amp.Command): """ key = "AdminServer2Portal" - arguments = [('packed_data', Compressed())] - errors = {Exception: 'EXCEPTION'} + arguments = [(b'packed_data', Compressed())] + errors = {Exception: b'EXCEPTION'} response = [] @@ -221,9 +218,9 @@ class MsgStatus(amp.Command): """ key = "MsgStatus" - arguments = [('status', amp.String())] - errors = {Exception: 'EXCEPTION'} - response = [('status', amp.String())] + arguments = [(b'status', amp.String())] + errors = {Exception: b'EXCEPTION'} + response = [(b'status', amp.String())] class FunctionCall(amp.Command): @@ -235,12 +232,12 @@ class FunctionCall(amp.Command): """ key = "FunctionCall" - arguments = [('module', amp.String()), - ('function', amp.String()), - ('args', amp.String()), - ('kwargs', amp.String())] - errors = {Exception: 'EXCEPTION'} - response = [('result', amp.String())] + arguments = [(b'module', amp.String()), + (b'function', amp.String()), + (b'args', amp.String()), + (b'kwargs', amp.String())] + errors = {Exception: b'EXCEPTION'} + response = [(b'result', amp.String())] # ------------------------------------------------------------- diff --git a/evennia/server/portal/ssl.py b/evennia/server/portal/ssl.py index 27703e43cf..2f57277fd6 100644 --- a/evennia/server/portal/ssl.py +++ b/evennia/server/portal/ssl.py @@ -3,8 +3,6 @@ This is a simple context factory for auto-creating SSL keys and certificates. """ - - import os import sys try: diff --git a/evennia/server/portal/telnet_ssl.py b/evennia/server/portal/telnet_ssl.py index cbeb108ac5..bda0bf2785 100644 --- a/evennia/server/portal/telnet_ssl.py +++ b/evennia/server/portal/telnet_ssl.py @@ -7,8 +7,6 @@ when starting and will warn if this was not possible. These will appear as files ssl.cert in mygame/server/. """ -from __future__ import print_function - import os try: from OpenSSL import crypto