From: Jeremy Stanley Date: Tue, 24 Dec 2019 22:23:32 +0000 (+0000) Subject: Eliminate exec() in Universe.new() X-Git-Tag: 0.1.0~19 X-Git-Url: https://mudpy.org/gitweb?p=mudpy.git;a=commitdiff_plain;h=e067958404628ee8881e132399f73a760efab8c1 Eliminate exec() in Universe.new() Replace questionable exec call in the new() method of the Universe class with cleaner getattr/setattr equivalents. --- diff --git a/mudpy/misc.py b/mudpy/misc.py index eea2f00..fca279a 100644 --- a/mudpy/misc.py +++ b/mudpy/misc.py @@ -406,7 +406,7 @@ class Universe: """Create a new, empty Universe (the Big Bang).""" new_universe = Universe() for attribute in vars(self).keys(): - exec("new_universe." + attribute + " = self." + attribute) + setattr(new_universe, attribute, getattr(self, attribute)) new_universe.reload_flag = False del self return new_universe