From d0c0054e898f4d2fd49cc6b0bd477cf7bdc05b68 Mon Sep 17 00:00:00 2001 From: John Cote Date: Wed, 8 Jul 2015 08:06:14 -0400 Subject: [PATCH] Fix an issue w/ describeException not working. --- otp/ai/MagicWordGlobal.py | 3 +-- otp/ai/TimeManager.py | 3 +-- toontown/ai/ServiceStart.py | 4 +--- toontown/rpc/ToontownRPCDispatcher.py | 3 +-- toontown/toonbase/ClientStart.py | 3 +-- toontown/toonbase/PythonUtil.py | 3 +++ toontown/uberdog/ServiceStart.py | 4 +--- 7 files changed, 9 insertions(+), 14 deletions(-) diff --git a/otp/ai/MagicWordGlobal.py b/otp/ai/MagicWordGlobal.py index be71fee6..5854ef46 100755 --- a/otp/ai/MagicWordGlobal.py +++ b/otp/ai/MagicWordGlobal.py @@ -1,4 +1,3 @@ -from toontown.toonbase import PythonUtil class MagicError(Exception): pass @@ -34,7 +33,7 @@ class Spellbook: except MagicError as e: return e.message except Exception: - return PythonUtil.describeException(backTrace=1) + return describeException(backTrace=1) finally: self.currentInvoker = None self.currentTarget = None diff --git a/otp/ai/TimeManager.py b/otp/ai/TimeManager.py index a7194aea..3b23aa19 100755 --- a/otp/ai/TimeManager.py +++ b/otp/ai/TimeManager.py @@ -2,7 +2,6 @@ from direct.directnotify import DirectNotifyGlobal from direct.distributed import DistributedObject from direct.distributed.ClockDelta import * from direct.showbase import PythonUtil -from toontown.toonbase import PythonUtil as TTPythonUtil from direct.showbase.DirectObject import * from direct.task import Task from panda3d.core import * @@ -122,7 +121,7 @@ class TimeManager(DistributedObject.DistributedObject): self.sendUpdate('setDisconnectReason', [disconnectCode]) def setExceptionInfo(self): - info = TTPythonUtil.describeException() + info = describeException() self.notify.info('Client exception: %s' % info) self.sendUpdate('setExceptionInfo', [info]) self.cr.flush() diff --git a/toontown/ai/ServiceStart.py b/toontown/ai/ServiceStart.py index 92ee2489..78d05e9a 100755 --- a/toontown/ai/ServiceStart.py +++ b/toontown/ai/ServiceStart.py @@ -18,8 +18,6 @@ sys.path.append( ) ) -from toontown.toonbase import PythonUtil - import argparse parser = argparse.ArgumentParser() @@ -65,6 +63,6 @@ try: except SystemExit: raise except Exception: - info = PythonUtil.describeException() + info = describeException() simbase.air.writeServerEvent('ai-exception', avId=simbase.air.getAvatarIdFromSender(), accId=simbase.air.getAccountIdFromSender(), exception=info) raise diff --git a/toontown/rpc/ToontownRPCDispatcher.py b/toontown/rpc/ToontownRPCDispatcher.py index 1c12be60..9e21669c 100755 --- a/toontown/rpc/ToontownRPCDispatcher.py +++ b/toontown/rpc/ToontownRPCDispatcher.py @@ -1,5 +1,4 @@ from direct.directnotify.DirectNotifyGlobal import directNotify -from toontown.toonbase import PythonUtil class ToontownRPCDispatcher: @@ -48,4 +47,4 @@ class ToontownRPCDispatcher: else: request.result(method(*params)) except: - request.error(-32603, PythonUtil.describeException()) + request.error(-32603, describeException()) diff --git a/toontown/toonbase/ClientStart.py b/toontown/toonbase/ClientStart.py index 882e030d..2249570c 100755 --- a/toontown/toonbase/ClientStart.py +++ b/toontown/toonbase/ClientStart.py @@ -189,6 +189,5 @@ if autoRun: except SystemExit: raise except: - from toontown.toonbase import PythonUtil - print PythonUtil.describeException() + print describeException() raise diff --git a/toontown/toonbase/PythonUtil.py b/toontown/toonbase/PythonUtil.py index 3fdabf59..a6f1f079 100644 --- a/toontown/toonbase/PythonUtil.py +++ b/toontown/toonbase/PythonUtil.py @@ -96,3 +96,6 @@ def describeException(backTrace = 4): description += "%s: %s" % (exceptionName, extraInfo) return description + +import __builtin__ +__builtin__.describeException = describeException diff --git a/toontown/uberdog/ServiceStart.py b/toontown/uberdog/ServiceStart.py index ef2589d6..0bc6bdb7 100755 --- a/toontown/uberdog/ServiceStart.py +++ b/toontown/uberdog/ServiceStart.py @@ -17,8 +17,6 @@ sys.path.append( ) ) -from toontown.toonbase import PythonUtil - import argparse parser = argparse.ArgumentParser() @@ -67,6 +65,6 @@ try: except SystemExit: raise except Exception: - info = PythonUtil.describeException() + info = describeException() simbase.air.writeServerEvent('uberdog-exception', simbase.air.getAvatarIdFromSender(), simbase.air.getAccountIdFromSender(), info) raise