diff --git a/toontown/building/SuitPlannerInteriorAI.py b/toontown/building/SuitPlannerInteriorAI.py index fed14fa..c2567c5 100644 --- a/toontown/building/SuitPlannerInteriorAI.py +++ b/toontown/building/SuitPlannerInteriorAI.py @@ -20,7 +20,7 @@ class SuitPlannerInteriorAI: self.dbg_defaultSuitType = None else: self.dbg_defaultSuitType = SuitDNA.getSuitType(dbg_defaultSuitName) - if isinstance(bldgLevel, bytes): + if isinstance(bldgLevel, str): self.notify.warning('bldgLevel is a string!') bldgLevel = int(bldgLevel) self._genSuitInfos(numFloors, bldgLevel, bldgTrack) diff --git a/toontown/catalog/CatalogAccessoryItem.py b/toontown/catalog/CatalogAccessoryItem.py index 8632b91..4f93315 100644 --- a/toontown/catalog/CatalogAccessoryItem.py +++ b/toontown/catalog/CatalogAccessoryItem.py @@ -3,7 +3,7 @@ from .CatalogAccessoryItemGlobals import * from toontown.toonbase import ToontownGlobals from toontown.toonbase import TTLocalizer from toontown.toon import ToonDNA -import random, types +import random from direct.showbase import PythonUtil from direct.gui.DirectGui import * from pandac.PandaModules import * @@ -231,7 +231,7 @@ class CatalogAccessoryItem(CatalogItem.CatalogItem): def applyColor(self, model, color): if model == None or color == None: return - if isinstance(color, bytes): + if isinstance(color, str): tex = loader.loadTexture(color) tex.setMinfilter(Texture.FTLinearMipmapLinear) tex.setMagfilter(Texture.FTLinear) diff --git a/toontown/catalog/CatalogItem.py b/toontown/catalog/CatalogItem.py index bb169d8..44258d7 100644 --- a/toontown/catalog/CatalogItem.py +++ b/toontown/catalog/CatalogItem.py @@ -5,7 +5,6 @@ from toontown.toonbase import ToontownGlobals from direct.interval.IntervalGlobal import * from direct.distributed.PyDatagram import PyDatagram from direct.distributed.PyDatagramIterator import PyDatagramIterator -import types import sys CatalogReverseType = None CatalogItemVersion = 8 @@ -333,7 +332,7 @@ class CatalogItem: matches = model.findAllMatches(partName) if color == None: matches.hide() - elif isinstance(color, bytes): + elif isinstance(color, str): tex = loader.loadTexture(color) tex.setMinfilter(Texture.FTLinearMipmapLinear) tex.setMagfilter(Texture.FTLinear) diff --git a/toontown/catalog/CatalogItemList.py b/toontown/catalog/CatalogItemList.py index 5249038..ec0ed5e 100644 --- a/toontown/catalog/CatalogItemList.py +++ b/toontown/catalog/CatalogItemList.py @@ -1,6 +1,5 @@ from . import CatalogItem from pandac.PandaModules import * -import types from direct.distributed.PyDatagram import PyDatagram from direct.distributed.PyDatagramIterator import PyDatagramIterator @@ -10,7 +9,7 @@ class CatalogItemList: self.store = store self.__blob = None self.__list = None - if isinstance(source, bytes): + if isinstance(source, str): self.__blob = source elif isinstance(source, list): self.__list = source[:] diff --git a/toontown/coghq/InGameEditor.py b/toontown/coghq/InGameEditor.py index ef9cb50..3134283 100644 --- a/toontown/coghq/InGameEditor.py +++ b/toontown/coghq/InGameEditor.py @@ -16,7 +16,6 @@ from direct.tkwidgets import Valuator from direct.tkwidgets import VectorWidgets from otp.level import LevelConstants from direct.directtools import DirectSession -import types import Pmw class InGameEditor(AppShell): @@ -376,7 +375,7 @@ class InGameEditor(AppShell): label = Label(frame, text=attribName, width=15, anchor=W, justify=LEFT) label.pack(side=LEFT, expand=0) for choice in params.get('choiceSet', []): - if type(choice) is bytes: + if type(choice) is str: choiceStr = choice else: choiceStr = repr(choice) @@ -427,7 +426,7 @@ class InGameEditor(AppShell): print('SENDING', value) self.level.setAttribEdit(entId, attribName, value) - if type(choice) is bytes: + if type(choice) is str: labelStr = choice else: labelStr = repr(choice) diff --git a/toontown/distributed/ToontownClientRepository.py b/toontown/distributed/ToontownClientRepository.py index db9434d..780f405 100644 --- a/toontown/distributed/ToontownClientRepository.py +++ b/toontown/distributed/ToontownClientRepository.py @@ -1,4 +1,3 @@ -import types import time from pandac.PandaModules import * from direct.distributed.ClockDelta import * @@ -467,7 +466,7 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository): dclass = self.dclassesByName[dclassName] pad.avatar.updateAllRequiredFields(dclass, di) gotData = 1 - if isinstance(pad.func, bytes): + if isinstance(pad.func, str): messenger.send(pad.func, list((gotData, pad.avatar) + pad.args)) else: pad.func(*(gotData, pad.avatar) + pad.args) diff --git a/toontown/launcher/ToontownLauncher.py b/toontown/launcher/ToontownLauncher.py index 11fc0e9..fb68db0 100644 --- a/toontown/launcher/ToontownLauncher.py +++ b/toontown/launcher/ToontownLauncher.py @@ -1,7 +1,6 @@ import os import sys import time -import types ltime = 1 and time.localtime() logSuffix = '%02d%02d%02d_%02d%02d%02d' % (ltime[0] - 2000, ltime[1], ltime[2], @@ -152,7 +151,7 @@ class ToontownLauncher(LauncherBase): t = type(value) if t == int: WindowsRegistry.setIntValue(self.toontownRegistryKey, name, value) - elif t == bytes: + elif t == str: WindowsRegistry.setStringValue(self.toontownRegistryKey, name, value) else: self.notify.warning('setRegistry: Invalid type for registry value: ' + repr(value)) diff --git a/toontown/pets/Pet.py b/toontown/pets/Pet.py index c8170fd..2cc2ca8 100644 --- a/toontown/pets/Pet.py +++ b/toontown/pets/Pet.py @@ -13,7 +13,6 @@ from toontown.toonbase import TTLocalizer from toontown.toonbase import ToontownGlobals from direct.showbase import PythonUtil import random -import types Component2IconDict = {'boredom': 'Bored', 'restlessness': None, 'playfulness': 'Play', @@ -633,7 +632,7 @@ class Pet(Avatar.Avatar): def getInteractIval(self, interactId): anims = self.InteractAnims[interactId] - if type(anims) == bytes: + if type(anims) == str: animIval = ActorInterval(self, anims) else: animIval = Sequence() diff --git a/toontown/pets/PetTricks.py b/toontown/pets/PetTricks.py index adff0df..4341e8b 100644 --- a/toontown/pets/PetTricks.py +++ b/toontown/pets/PetTricks.py @@ -1,6 +1,5 @@ from direct.showbase.PythonUtil import Enum, invertDictLossless from direct.interval.IntervalGlobal import * -import types import random Tricks = Enum('JUMP, BEG, PLAYDEAD, ROLLOVER, BACKFLIP, DANCE, SPEAK, BALK,') NonHappyMinActualTrickAptitude = 0.1 @@ -62,7 +61,7 @@ TrickSounds = {Tricks.BACKFLIP: 'phase_5/audio/sfx/backflip.mp3', def getSoundIval(trickId): sounds = TrickSounds.get(trickId, None) if sounds: - if type(sounds) == bytes: + if type(sounds) == str: sound = loader.loadSfx(sounds) return SoundInterval(sound) else: @@ -79,7 +78,7 @@ def getTrickIval(pet, trickId): anims = TrickAnims[trickId] animRate = random.uniform(0.9, 1.1) waitTime = random.uniform(0.0, 1.0) - if type(anims) == bytes: + if type(anims) == str: if trickId == Tricks.JUMP: animIval = Parallel() animIval.append(ActorInterval(pet, anims, playRate=animRate)) diff --git a/toontown/suit/BossCog.py b/toontown/suit/BossCog.py index 0c216dc..b7b5e26 100644 --- a/toontown/suit/BossCog.py +++ b/toontown/suit/BossCog.py @@ -14,7 +14,6 @@ from . import SuitDNA from toontown.battle import BattleProps from direct.showbase.PythonUtil import Functor import string -import types GenericModel = 'phase_9/models/char/bossCog' ModelDict = {'s': 'phase_9/models/char/sellbotBoss', 'm': 'phase_10/models/char/cashbotBoss', @@ -535,7 +534,7 @@ class BossCog(Avatar.Avatar): self.raised = 1 elif anim == 'Fb_fall': ival = Parallel(ActorInterval(self, 'Fb_fall'), Sequence(SoundInterval(self.reelSfx, node=self), SoundInterval(self.deathSfx))) - elif isinstance(anim, bytes): + elif isinstance(anim, str): ival = ActorInterval(self, anim) else: ival = anim diff --git a/toontown/toon/TTEmote.py b/toontown/toon/TTEmote.py index 86bffae..4516685 100644 --- a/toontown/toon/TTEmote.py +++ b/toontown/toon/TTEmote.py @@ -3,7 +3,6 @@ from direct.interval.IntervalGlobal import * from otp.otpbase import OTPLocalizer from toontown.toonbase import TTLocalizer from otp.otpbase import OTPLocalizer -import types from direct.showbase import PythonUtil from pandac.PandaModules import * from libotp import * @@ -563,7 +562,7 @@ class TTEmote(Emote.Emote): self.unlockStateChangeMsg() def disable(self, index, toon): - if isinstance(index, bytes): + if isinstance(index, str): index = OTPLocalizer.EmoteFuncDict[index] self.emoteFunc[index][1] = self.emoteFunc[index][1] + 1 if toon is base.localAvatar: @@ -571,7 +570,7 @@ class TTEmote(Emote.Emote): self.emoteEnableStateChanged() def enable(self, index, toon): - if isinstance(index, bytes): + if isinstance(index, str): index = OTPLocalizer.EmoteFuncDict[index] self.emoteFunc[index][1] = self.emoteFunc[index][1] - 1 if toon is base.localAvatar: diff --git a/toontown/toon/Toon.py b/toontown/toon/Toon.py index 3b0a7f4..ee0de52 100644 --- a/toontown/toon/Toon.py +++ b/toontown/toon/Toon.py @@ -25,7 +25,6 @@ from toontown.effects import DustCloud from direct.showbase.PythonUtil import Functor from toontown.distributed import DelayDelete from . import AccessoryGlobals -import types import importlib import functools @@ -2196,7 +2195,7 @@ class Toon(Avatar.Avatar, ToonHead): for partName, pieceNames in pieces: part = self.getPart(partName, lodName) if part: - if type(pieceNames) == bytes: + if type(pieceNames) == str: pieceNames = (pieceNames,) for pieceName in pieceNames: npc = part.findAllMatches('**/%s;+s' % pieceName)