# HG changeset patch # User Paul Boddie # Date 1100875533 -3600 # Node ID be1a46eda340fdf27b61441001db6d5e89d06bfc # Parent aec972e2534be0d5cb521d11930d32aed61d7139 Introduced class initialisation avoidance for abstract classes (although this needs further investigation). diff -r aec972e2534b -r be1a46eda340 classhook.py --- a/classhook.py Fri Nov 19 15:45:02 2004 +0100 +++ b/classhook.py Fri Nov 19 15:45:33 2004 +0100 @@ -153,13 +153,14 @@ translator = bytecode.ClassTranslator(class_file) cls = translator.process(global_names) module.__dict__[cls.__name__] = cls - classes.append(cls) + classes.append((cls, class_file)) # Finally, call __clinit__ methods for all relevant classes. - for cls in classes: - if hasattr(cls, "__clinit__"): - cls.__clinit__() + for cls, class_file in classes: + if not classfile.has_flags(class_file.access_flags, [classfile.ABSTRACT]): + if hasattr(cls, "__clinit__"): + cls.__clinit__() return module