> Is the behavior below expected?
> If so, why is the exception not caught?
> Thanks,
> Alan Isaac
> 
>>>> x,y='',''
>>>> try: x/y
> ... except TypeError: print 'oops'
> ...
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> TypeError: unsupported operand type(s) for /: 'str' and 'str'

A typo in your code?  It works for me(tm)...

Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit 
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more 
information.
 >>> x,y = '',''
 >>> try: x/y
... except TypeError: print 'oops'
...
oops

-tkc



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to