# HG changeset patch # User Paul Boddie # Date 1106865112 -3600 # Node ID f83c8a6dd9354b90ae4018b8a8a0087cbf203c0a # Parent f71be46f1596009e763cb3f503d5924964279337 Improved exceptions when classes cannot be imported. Changed the definition of the "wide" bytecode method to just raise an exception. diff -r f71be46f1596 -r f83c8a6dd935 javaclass/bytecode.py --- a/javaclass/bytecode.py Thu Jan 27 23:30:38 2005 +0100 +++ b/javaclass/bytecode.py Thu Jan 27 23:31:52 2005 +0100 @@ -2007,7 +2007,7 @@ def wide(self, code, program): # NOTE: To be implemented. - return number_of_arguments + raise NotImplementedError, "wide" def disassemble(class_file, method): disassembler = BytecodeDisassembler(class_file) @@ -2340,7 +2340,10 @@ obj = __import__(super_class_module_name, global_names, {}, []) for super_class_name_part in super_class_name_parts[1:] or [super_class_name]: #print "*", obj, super_class_name_part - obj = getattr(obj, super_class_name_part) + try: + obj = getattr(obj, super_class_name_part) + except AttributeError: + raise AttributeError, "Cannot find class '%s' in Java package '%s'" % (super_class_name_part, super_class_module_name) return (obj,) def make_varnames(self, nlocals, method_is_static=0):