Version numbers in traceback

Ype Kingma ykingma at accessforall.nl
Wed Jul 25 15:50:17 EDT 2001


Martin von Loewis wrote:
> 
> Dale Strickland-Clark <dale at riverhall.NOSPAMco.uk> writes:
> 
> > Is there a standard way for a module to register its version number so that it is reported by
> > traceback or other debugging tools.
> >
> > I thought something nice and simple like
> >
> > _Module_Version_ = '10.5C'
> >
> > would be nice.
> 
> The standard constant for a module version is __version__. However,
> there is no way to integrate it into a traceback. Instead, debugging

It's not too difficult to catch the exception yourself and provide
a traceback text looking quite similar to the standard and including
the __version__ of the module of each function on the stack.

> tools would need to find out the module of each function in the
> traceback themselves (which sometimes cannot be done), and then access
> the __version__ if desired. I don't think that the traceback module
> should fetch __version__, though.
> 
> Regards,
> Martin

Good luck,
Ype

-- 
email at xs4all.nl



More information about the Python-list mailing list