Re: [Zope] Weird interaction between int() and DateTime.timeTime

2000-05-25 Thread jq-zope

[EMAIL PROTECTED] writes:

> >>> t.timeTime()
> 953146937.0
> >>> int( t.timeTime() )
> 953146936  < This is wrong
> >>> int( 953146937.0 )
> 953146937   
> 
> Any ideas on how this can be happening. Stepping through the DateTime module
> yields the sensible return value of 953146937.0 but somehow int() converts
> this incorrectly.

int() works fine (truncating everything behind "."):

>>> t.timeTime() == 953146937.0
0
>>> t.timeTime() -  953146937.0
-4.76837158203e-07  
>>> int (round (t.timeTime()))
953146937   

jens


-- 
   http://www.jquade.de/

And here they are: Nitwit! Blubber! Oddment! Tweak!
  -- Albus Dumbledore


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Catching SQL Exceptions in an external method

2000-05-23 Thread jq-zope

"Stolker, Wim" <[EMAIL PROTECTED]> writes:

> I do not know how the exceptions are named.
> If I catch the exception with a general 'except:' statement
> it works but I cannot see the info from the exception,

sys.exc_* should work, as in 

import sys

try:
raise "Blubber"

except:
print "Exception type  %s" % sys.exc_type
print "Exception value %s" % sys.exc_value





-- 
   http://www.jquade.de/

For every complex problem there is an 
answer that is clear, simple, and wrong. -- H L Mencken


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )