[Tutor] crash when importing random or sys module, in my embedded python

R. Alan Monroe R. Alan Monroe" <amonroe@columbus.rr.com
Thu Jun 19 20:52:03 2003


> At 22:30 2003-06-18 -0400, R. Alan Monroe wrote:
>>Yeah I just made a backup then commented out the _verify. It works now

> What if you change %g to %r instead, to show more decimals?
> What will the traceback message be then? If you really have

from random.py source:
def _verify(name, computed, expected):
    if abs(computed - expected) > 1e-7:
        raise ValueError(
            "computed value for %s deviates too much "
            "(computed %r, expected %r)" % (name, computed, expected))

TWOPI = 2.0*_pi
_verify('TWOPI', TWOPI, 6.28318530718)



and the error with %r:
('computed value for TWOPI deviates too much (computed 6.2831854820251465, expected 6.2831853071800001)',)



Alan