summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEevee (Lexy Munroe) <eevee.git@veekun.com>2016-08-24 15:54:41 -0700
committerEevee (Lexy Munroe) <eevee.git@veekun.com>2016-08-24 15:54:41 -0700
commitc71e7dd9778c7a2a563dbd1e780d79ea766a05d9 (patch)
treef6c5032d70232d64a51bfd48663c579a4c45e48b
parenta64657988a50522885618998e7f14168c299a19b (diff)
Remove use of new.classobj
-rw-r--r--pokemontools/crystal.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/pokemontools/crystal.py b/pokemontools/crystal.py
index 10226e0..a34203e 100644
--- a/pokemontools/crystal.py
+++ b/pokemontools/crystal.py
@@ -8,12 +8,9 @@ from __future__ import absolute_import
import os
import sys
import inspect
-import hashlib
import json
from copy import copy, deepcopy
import subprocess
-from new import classobj
-import random
import logging
# for capwords
@@ -1611,7 +1608,7 @@ def create_movement_commands(debug=False):
klass_name = cmd_name+"Command"
params["id"] = copy(byte)
params["macro_name"] = cmd_name
- klass = classobj(copy(klass_name), (MovementCommand,), deepcopy(params))
+ klass = type(copy(klass_name), (MovementCommand,), deepcopy(params))
globals()[klass_name] = klass
movement_command_classes2.append(klass)
@@ -1621,7 +1618,7 @@ def create_movement_commands(debug=False):
del klass_name
else:
klass_name = cmd_name+"Command"
- klass = classobj(klass_name, (MovementCommand,), params)
+ klass = type(klass_name, (MovementCommand,), params)
globals()[klass_name] = klass
movement_command_classes2.append(klass)
# later an individual klass will be instantiated to handle something
@@ -2431,7 +2428,7 @@ def create_command_classes(debug=False):
logging.debug("each is {0} and thing[class] is {1}".format(each, thing["class"]))
params["size"] += thing["class"].size
klass_name = cmd_name+"Command"
- klass = classobj(klass_name, (Command,), params)
+ klass = type(klass_name, (Command,), params)
globals()[klass_name] = klass
klasses.append(klass)
# later an individual klass will be instantiated to handle something
@@ -2548,7 +2545,7 @@ def create_music_command_classes(debug=False):
logging.debug("each is {0} and thing[class] is {1}".format(each, thing["class"]))
params["size"] += thing["class"].size
klass_name = cmd_name+"Command"
- klass = classobj(klass_name, (Command,), params)
+ klass = type(klass_name, (Command,), params)
globals()[klass_name] = klass
if klass.macro_name == "notetype":
klass.allowed_lengths = [1, 2]
@@ -2808,7 +2805,7 @@ def create_effect_command_classes(debug=False):
logging.debug("each is {0} and thing[class] is {1}".format(each, thing["class"]))
params["size"] += thing["class"].size
klass_name = cmd_name+"Command"
- klass = classobj(klass_name, (Command,), params)
+ klass = type(klass_name, (Command,), params)
globals()[klass_name] = klass
klasses.append(klass)
# later an individual klass will be instantiated to handle something