This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Python: avoid RuntimeError exception?


The Python documentation (Library manual, builtin exceptions chapter) implies that RuntimeError is used if nothing better is available, i.e., it's sort of deprecated.

The GDB Python code uses it for most errors, even when a more natural exception is also available.  For example, looking up a structure field in a gdb.Value object raises RuntimeError if the field is not found, instead of the expected KeyError.

It would be good to tweak some of these to match Python conventions.  The drawback is that existing checks in existing scripts might need updating.

What's the right answer?

	paul


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]