From e067958404628ee8881e132399f73a760efab8c1 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Tue, 24 Dec 2019 22:23:32 +0000 Subject: [PATCH] Eliminate exec() in Universe.new() Replace questionable exec call in the new() method of the Universe class with cleaner getattr/setattr equivalents. --- mudpy/misc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.11.0