changeset aa00cee9abb1 in /z/repo/m5 details: http://repo.m5sim.org/m5?cmd=changeset;node=aa00cee9abb1 description: SimObject: allow modules in subclass definitions
In particular, this avoids crashing when you do an import (like "import pdb") inside a SimObject subclass definition. diffstat: src/python/m5/SimObject.py | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diffs (22 lines): diff -r 681497e0356b -r aa00cee9abb1 src/python/m5/SimObject.py --- a/src/python/m5/SimObject.py Tue May 31 02:56:22 2011 -0400 +++ b/src/python/m5/SimObject.py Wed Jun 01 21:43:13 2011 -0700 @@ -29,7 +29,7 @@ # Nathan Binkert import sys -from types import FunctionType, MethodType +from types import FunctionType, MethodType, ModuleType try: import pydot @@ -130,7 +130,8 @@ def public_value(key, value): return key.startswith('_') or \ - isinstance(value, (FunctionType, MethodType, classmethod, type)) + isinstance(value, (FunctionType, MethodType, ModuleType, + classmethod, type)) # The metaclass for SimObject. This class controls how new classes # that derive from SimObject are instantiated, and provides inherited _______________________________________________ gem5-dev mailing list gem5-dev@m5sim.org http://m5sim.org/mailman/listinfo/gem5-dev