From f9c4a31271fa3065a5ef5adea69ea5f78cc5777e Mon Sep 17 00:00:00 2001 From: John Cote Date: Tue, 29 Jun 2021 21:58:21 -0400 Subject: [PATCH] launcher: Fix crash --- otp/ai/TimeManager.py | 3 ++- otp/launcher/LauncherBase.py | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/otp/ai/TimeManager.py b/otp/ai/TimeManager.py index bbafe96..d58892b 100644 --- a/otp/ai/TimeManager.py +++ b/otp/ai/TimeManager.py @@ -6,6 +6,7 @@ from direct.distributed import DistributedObject from direct.directnotify import DirectNotifyGlobal from otp.otpbase import OTPGlobals from direct.showbase import PythonUtil +from otp.otpbase.PythonUtil import describeException from direct.showbase import GarbageReport import base64 import time @@ -149,7 +150,7 @@ class TimeManager(DistributedObject.DistributedObject): self.sendUpdate('setDisconnectReason', [disconnectCode]) def setExceptionInfo(self): - info = PythonUtil.describeException() + info = describeException() self.notify.info('Client exception: %s' % info) self.sendUpdate('setExceptionInfo', [info]) self.cr.flush() diff --git a/otp/launcher/LauncherBase.py b/otp/launcher/LauncherBase.py index acd2f6c..7ef2ec6 100644 --- a/otp/launcher/LauncherBase.py +++ b/otp/launcher/LauncherBase.py @@ -175,20 +175,20 @@ class LauncherBase(DirectObject): try: self._runTaskManager() except SystemExit: - if hasattr(__builtin__, 'base'): + if hasattr(builtins, 'base'): base.destroy() self.notify.info('Normal exit.') raise except: self.setPandaErrorCode(12) self.notify.warning('Handling Python exception.') - if hasattr(__builtin__, 'base') and getattr(base, 'cr', None): + if hasattr(builtins, 'base') and getattr(base, 'cr', None): if base.cr.timeManager: from otp.otpbase import OTPGlobals base.cr.timeManager.setDisconnectReason(OTPGlobals.DisconnectPythonError) base.cr.timeManager.setExceptionInfo() base.cr.sendDisconnect() - if hasattr(__builtin__, 'base'): + if hasattr(builtins, 'base'): base.destroy() self.notify.info('Exception exit.\n') import traceback